New: release name in manual search will link to info URL if available

This commit is contained in:
Mark McDowall 2014-08-10 22:54:31 -07:00
parent 135fb32bdb
commit 2008b32018
3 changed files with 33 additions and 5 deletions

View File

@ -0,0 +1,28 @@
'use strict';
define(
[
'Cells/NzbDroneCell'
], function (NzbDroneCell) {
return NzbDroneCell.extend({
className: 'release-title-cell',
render: function () {
this.$el.empty();
var title = this.model.get('title');
var infoUrl = this.model.get('infoUrl');
if (infoUrl) {
this.$el.html('<a href="{0}">{1}</a>'.format(infoUrl, title));
}
else {
this.$el.html(title);
}
return this;
}
});
});

View File

@ -102,7 +102,7 @@ td.episode-status-cell, td.quality-cell {
} }
} }
.nzb-title-cell { .release-title-cell {
max-width: 400px; max-width: 400px;
word-wrap: break-word; word-wrap: break-word;
} }

View File

@ -3,12 +3,13 @@ define(
[ [
'marionette', 'marionette',
'backgrid', 'backgrid',
'Cells/ReleaseTitleCell',
'Cells/FileSizeCell', 'Cells/FileSizeCell',
'Cells/QualityCell', 'Cells/QualityCell',
'Cells/ApprovalStatusCell', 'Cells/ApprovalStatusCell',
'Release/DownloadReportCell', 'Release/DownloadReportCell',
'Release/AgeCell' 'Release/AgeCell'
], function (Marionette, Backgrid, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell, AgeCell) { ], function (Marionette, Backgrid, ReleaseTitleCell, FileSizeCell, QualityCell, ApprovalStatusCell, DownloadReportCell, AgeCell) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Episode/Search/ManualLayoutTemplate', template: 'Episode/Search/ManualLayoutTemplate',
@ -25,9 +26,9 @@ define(
cell : AgeCell cell : AgeCell
}, },
{ {
name : 'title', name : 'this',
label : 'Title', label : 'Title',
cell : Backgrid.StringCell.extend({ className: 'nzb-title-cell' }) cell : ReleaseTitleCell
}, },
{ {
name : 'indexer', name : 'indexer',
@ -44,7 +45,6 @@ define(
label : 'Quality', label : 'Quality',
cell : QualityCell cell : QualityCell
}, },
{ {
name : 'rejections', name : 'rejections',
label : '', label : '',