mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
New: Blacklist release from episode details
This commit is contained in:
parent
0951e0c74b
commit
2427b1f254
41
src/UI/Episode/Activity/EpisodeActivityActionsCell.js
Normal file
41
src/UI/Episode/Activity/EpisodeActivityActionsCell.js
Normal 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
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
@ -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
|
||||
}
|
||||
],
|
||||
|
||||
|
@ -24,6 +24,7 @@ define(
|
||||
type: 'POST',
|
||||
data: data
|
||||
});
|
||||
|
||||
vent.trigger(vent.Commands.CloseModalCommand);
|
||||
}
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user