cleaned up all the cells. there is a cell for pretty much everything.

This commit is contained in:
kay.one
2013-06-09 13:51:32 -07:00
parent ac3582d5c4
commit 70cfa5e685
42 changed files with 432 additions and 261 deletions

View File

@@ -0,0 +1,19 @@
"use strict";
NzbDrone.Release.ApprovalStatusCell = Backgrid.Cell.extend({
className: "approval-status-cell",
render: function () {
var rejections = this.model.get(this.column.get("name"));
var result = '';
_.each(rejections, function (reason) {
result += reason + ' ';
});
this.$el.html(result);
this.delegateEvents();
return this;
}
});

View File

@@ -0,0 +1,27 @@
"use strict";
NzbDrone.Release.DownloadReportCell = Backgrid.Cell.extend({
className: "download-report-cell",
events: {
'click': '_onClick'
},
_onClick: function () {
var self = this;
this.$el.html('<i class ="icon-spinner icon-spin" />');
this.model.save()
.always(function () {
self.$el.html('<i class ="icon-download-alt" />');
});
},
render: function () {
this.$el.html('<i class ="icon-download-alt" />');
return this;
}
});

View File

@@ -2,11 +2,12 @@
define([
'app',
'Release/Collection',
'Release/ApprovalStatusCell',
'Shared/SpinnerView',
'Shared/Toolbar/ToolbarLayout',
'Shared/Cells/EpisodeNumberCell',
'Shared/Cells/FileSizeCell',
'Shared/Cells/ApprovalStatusCell'
'Cells/EpisodeNumberCell',
'Cells/FileSizeCell',
'Cells/IndexerCell'
],
function () {
NzbDrone.Release.Layout = Backbone.Marionette.Layout.extend({
@@ -22,13 +23,13 @@ define([
name : 'indexer',
label : 'Indexer',
sortable: true,
cell : Backgrid.StringCell
cell : NzbDrone.Cells.IndexerCell
},
{
name : 'size',
label : 'Size',
sortable: true,
cell : NzbDrone.Shared.Cells.FileSizeCell
cell : NzbDrone.Cells.FileSizeCell
},
{
name : 'title',
@@ -38,16 +39,14 @@ define([
},
{
name : 'episodeNumbers',
season : 'seasonNumber',
airDate : 'airDate',
episodes: 'episodeNumbers',
label : 'season',
cell : NzbDrone.Shared.Cells.EpisodeNumberCell
cell : NzbDrone.Cells.EpisodeNumberCell
},
{
name : 'rejections',
label: 'decision',
cell : NzbDrone.Shared.Cells.ApprovalStatusCell
cell : NzbDrone.Release.ApprovalStatusCell
}
],