New: Blacklist release from episode details

pull/6/head
Mark McDowall 11 years ago
parent 0951e0c74b
commit 2427b1f254

@ -0,0 +1,41 @@
'use strict';
define(
[
'jquery',
'vent',
'marionette',
'Cells/NzbDroneCell'
], function ($, vent, Marionette, NzbDroneCell) {
return NzbDroneCell.extend({
className: 'episode-actions-cell',
events: {
'click .x-failed' : '_markAsFailed'
},
render: function () {
this.$el.empty();
if (this.model.get('eventType') === 'grabbed') {
this.$el.html('<i class="icon-nd-delete x-failed" title="Mark download as failed"></i>');
}
return this;
},
_markAsFailed: function () {
var url = window.NzbDrone.ApiRoot + '/history/failed';
var data = {
id: this.model.get('id')
};
$.ajax({
url: url,
type: 'POST',
data: data
});
}
});
});

@ -7,9 +7,18 @@ define(
'Cells/EventTypeCell', 'Cells/EventTypeCell',
'Cells/QualityCell', 'Cells/QualityCell',
'Cells/RelativeDateCell', 'Cells/RelativeDateCell',
'Episode/Activity/EpisodeActivityActionsCell',
'Episode/Activity/NoActivityView', 'Episode/Activity/NoActivityView',
'Shared/LoadingView' 'Shared/LoadingView'
], function (Marionette, Backgrid, HistoryCollection, EventTypeCell, QualityCell, RelativeDateCell, NoActivityView, LoadingView) { ], function (Marionette,
Backgrid,
HistoryCollection,
EventTypeCell,
QualityCell,
RelativeDateCell,
EpisodeActivityActionsCell,
NoActivityView,
LoadingView) {
return Marionette.Layout.extend({ return Marionette.Layout.extend({
template: 'Episode/Activity/EpisodeActivityLayoutTemplate', template: 'Episode/Activity/EpisodeActivityLayoutTemplate',
@ -40,6 +49,12 @@ define(
name : 'date', name : 'date',
label: 'Date', label: 'Date',
cell : RelativeDateCell cell : RelativeDateCell
},
{
name : 'this',
label : '',
cell : EpisodeActivityActionsCell,
sortable: false
} }
], ],

@ -24,6 +24,7 @@ define(
type: 'POST', type: 'POST',
data: data data: data
}); });
vent.trigger(vent.Commands.CloseModalCommand); vent.trigger(vent.Commands.CloseModalCommand);
} }
}); });

Loading…
Cancel
Save