New: Blacklist release from episode details

This commit is contained in:
Mark McDowall 2014-04-04 08:32:06 -07:00
parent 0951e0c74b
commit 2427b1f254
3 changed files with 58 additions and 1 deletions

View File

@ -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
});
}
});
});

View File

@ -7,9 +7,18 @@ define(
'Cells/EventTypeCell',
'Cells/QualityCell',
'Cells/RelativeDateCell',
'Episode/Activity/EpisodeActivityActionsCell',
'Episode/Activity/NoActivityView',
'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({
template: 'Episode/Activity/EpisodeActivityLayoutTemplate',
@ -40,6 +49,12 @@ define(
name : 'date',
label: 'Date',
cell : RelativeDateCell
},
{
name : 'this',
label : '',
cell : EpisodeActivityActionsCell,
sortable: false
}
],

View File

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