New: Details for import/grab on Episode Activity tab

pull/4/head
Mark McDowall 10 years ago
parent 4b5cf7d7d3
commit 78e5209cfd

@ -129,6 +129,16 @@ td.episode-status-cell, td.quality-cell {
} }
} }
.episode-activity-details-cell {
width : 18px;
}
.episode-detail-modal {
.episode-actions-cell {
width : 18px;
}
}
.series-actions-cell { .series-actions-cell {
width : 56px; width : 56px;
min-width : 56px; min-width : 56px;

@ -0,0 +1,35 @@
'use strict';
define(
[
'jquery',
'vent',
'marionette',
'Cells/NzbDroneCell',
'History/Details/HistoryDetailsView',
'bootstrap'
], function ($, vent, Marionette, NzbDroneCell, HistoryDetailsView) {
return NzbDroneCell.extend({
className: 'episode-activity-details-cell',
render: function () {
this.$el.empty();
this.$el.html('<i class="icon-info-sign"></i>');
var html = new HistoryDetailsView({ model: this.model }).render().$el;
this.$el.popover({
content : html,
html : true,
trigger : 'hover',
title : 'Details',
placement: 'left',
container: this.$el
});
return this;
}
});
});

@ -8,6 +8,7 @@ define(
'Cells/QualityCell', 'Cells/QualityCell',
'Cells/RelativeDateCell', 'Cells/RelativeDateCell',
'Episode/Activity/EpisodeActivityActionsCell', 'Episode/Activity/EpisodeActivityActionsCell',
'Episode/Activity/EpisodeActivityDetailsCell',
'Episode/Activity/NoActivityView', 'Episode/Activity/NoActivityView',
'Shared/LoadingView' 'Shared/LoadingView'
], function (Marionette, ], function (Marionette,
@ -17,6 +18,7 @@ define(
QualityCell, QualityCell,
RelativeDateCell, RelativeDateCell,
EpisodeActivityActionsCell, EpisodeActivityActionsCell,
EpisodeActivityDetailsCell,
NoActivityView, NoActivityView,
LoadingView) { LoadingView) {
@ -50,6 +52,12 @@ define(
label: 'Date', label: 'Date',
cell : RelativeDateCell cell : RelativeDateCell
}, },
{
name : 'this',
label : '',
cell : EpisodeActivityDetailsCell,
sortable: false
},
{ {
name : 'this', name : 'this',
label : '', label : '',

@ -0,0 +1,40 @@
'use strict';
define(
[
'jquery',
'vent',
'marionette',
'History/Details/HistoryDetailsView'
], function ($, vent, Marionette, HistoryDetailsView) {
return Marionette.Layout.extend({
template: 'History/Details/HistoryDetailsLayoutTemplate',
regions: {
bodyRegion: '.modal-body'
},
events: {
'click .x-mark-as-failed': '_markAsFailed'
},
onShow: function () {
this.bodyRegion.show(new HistoryDetailsView({ model: this.model }));
},
_markAsFailed: function () {
var url = window.NzbDrone.ApiRoot + '/history/failed';
var data = {
id: this.model.get('id')
};
$.ajax({
url: url,
type: 'POST',
data: data
});
vent.trigger(vent.Commands.CloseModalCommand);
}
});
});

@ -0,0 +1,23 @@
<div class="modal-dialog">
<div class="modal-content">
<div class="history-detail-modal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3>
{{#if_eq eventType compare="grabbed"}}Grabbed{{/if_eq}}
{{#if_eq eventType compare="downloadFailed"}}Download Failed{{/if_eq}}
{{#if_eq eventType compare="downloadFolderImported"}}Episode Imported{{/if_eq}}
</h3>
</div>
<div class="modal-body">
</div>
<div class="modal-footer">
{{#if_eq eventType compare="grabbed"}}<button class="btn btn-danger x-mark-as-failed">mark as failed</button>{{/if_eq}}
<button class="btn" data-dismiss="modal">close</button>
</div>
</div>
</div>
</div>

@ -1,32 +1,11 @@
'use strict'; 'use strict';
define( define(
[ [
'jquery',
'vent',
'marionette', 'marionette',
'History/Details/HistoryDetailsAge' 'History/Details/HistoryDetailsAge'
], function ($, vent, Marionette) { ], function (Marionette) {
return Marionette.ItemView.extend({ return Marionette.ItemView.extend({
template: 'History/Details/HistoryDetailsViewTemplate', template: 'History/Details/HistoryDetailsViewTemplate'
events: {
'click .x-mark-as-failed': '_markAsFailed'
},
_markAsFailed: function () {
var url = window.NzbDrone.ApiRoot + '/history/failed';
var data = {
id: this.model.get('id')
};
$.ajax({
url: url,
type: 'POST',
data: data
});
vent.trigger(vent.Commands.CloseModalCommand);
}
}); });
}); });

@ -1,93 +1,71 @@
<div class="modal-dialog"> {{#if_eq eventType compare="grabbed"}}
<div class="modal-content"> <dl class="dl-horizontal">
<div class="history-detail-modal">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
<h3> <dt>Name:</dt>
{{#if_eq eventType compare="grabbed"}}Grabbed{{/if_eq}} <dd>{{sourceTitle}}</dd>
{{#if_eq eventType compare="downloadFailed"}}Download Failed{{/if_eq}}
{{#if_eq eventType compare="downloadFolderImported"}}Episode Imported{{/if_eq}}
</h3>
</div> {{#with data}}
<div class="modal-body"> {{#if indexer}}
{{#if_eq eventType compare="grabbed"}} <dt>Indexer:</dt>
<dl class="dl-horizontal"> <dd>{{indexer}}</dd>
{{/if}}
<dt>Name:</dt> {{#if releaseGroup}}
<dd>{{sourceTitle}}</dd> <dt>Release Group:</dt>
<dd>{{releaseGroup}}</dd>
{{/if}}
{{#with data}} {{#if nzbInfoUrl}}
{{#if indexer}} <dt>Info:</dt>
<dt>Indexer:</dt> <dd><a href="{{nzbInfoUrl}}">{{nzbInfoUrl}}</a></dd>
<dd>{{indexer}}</dd> {{/if}}
{{/if}}
{{#if releaseGroup}} {{#if downloadClient}}
<dt>Release Group:</dt> <dt>Download Client:</dt>
<dd>{{releaseGroup}}</dd> <dd>{{downloadClient}}</dd>
{{/if}} {{/if}}
{{#if nzbInfoUrl}} {{#if downloadClientId}}
<dt>Info:</dt> <dt>Download Client ID:</dt>
<dd><a href="{{nzbInfoUrl}}">{{nzbInfoUrl}}</a></dd> <dd>{{downloadClientId}}</dd>
{{/if}} {{/if}}
{{#if downloadClient}} {{#if age}}
<dt>Download Client:</dt> {{historyAge}}
<dd>{{downloadClient}}</dd> {{/if}}
{{/if}} {{/with}}
</dl>
{{/if_eq}}
{{#if_eq eventType compare="downloadFailed"}}
<dl class="dl-horizontal">
{{#if downloadClientId}} <dt>Name:</dt>
<dt>Download Client ID:</dt> <dd>{{sourceTitle}}</dd>
<dd>{{downloadClientId}}</dd>
{{/if}}
{{#if age}} {{#with data}}
{{historyAge}} <dt>Message:</dt>
{{/if}} <dd>{{message}}</dd>
{{/with}} {{/with}}
</dl> </dl>
{{/if_eq}} {{/if_eq}}
{{#if_eq eventType compare="downloadFailed"}} {{#if_eq eventType compare="downloadFolderImported"}}
<dl class="dl-horizontal"> <dl class="dl-horizontal">
<dt>Name:</dt> {{#if sourceTitle}}
<dd>{{sourceTitle}}</dd> <dt>Name:</dt>
<dd>{{sourceTitle}}</dd>
{{/if}}
{{#with data}} {{#with data}}
<dt>Message:</dt> {{#if droppedPath}}
<dd>{{message}}</dd> <dt>Source:</dt>
{{/with}} <dd>{{droppedPath}}</dd>
</dl> {{/if}}
{{/if_eq}}
{{#if_eq eventType compare="downloadFolderImported"}}
<dl class="dl-horizontal">
{{#if sourceTitle}} {{#if importedPath}}
<dt>Name:</dt> <dt>Imported To:</dt>
<dd>{{sourceTitle}}</dd> <dd>{{importedPath}}</dd>
{{/if}} {{/if}}
{{/with}}
{{#with data}} </dl>
{{#if droppedPath}} {{/if_eq}}
<dt>Source:</dt>
<dd>{{droppedPath}}</dd>
{{/if}}
{{#if importedPath}}
<dt>Imported To:</dt>
<dd>{{importedPath}}</dd>
{{/if}}
{{/with}}
</dl>
{{/if_eq}}
</div>
<div class="modal-footer">
{{#if_eq eventType compare="grabbed"}}<button class="btn btn-danger x-mark-as-failed">mark as failed</button>{{/if_eq}}
<button class="btn" data-dismiss="modal">close</button>
</div>
</div>
</div>
</div>

@ -266,6 +266,10 @@
margin-top : 30px; margin-top : 30px;
font-size : 12px; font-size : 12px;
} }
.episode-activity-details-cell .popover {
max-width: 800px;
}
} }
.season-grid { .season-grid {

@ -7,10 +7,10 @@ define(
'Series/Edit/EditSeriesView', 'Series/Edit/EditSeriesView',
'Series/Delete/DeleteSeriesView', 'Series/Delete/DeleteSeriesView',
'Episode/EpisodeDetailsLayout', 'Episode/EpisodeDetailsLayout',
'History/Details/HistoryDetailsView', 'History/Details/HistoryDetailsLayout',
'System/Logs/Table/Details/LogDetailsView', 'System/Logs/Table/Details/LogDetailsView',
'Rename/RenamePreviewLayout' 'Rename/RenamePreviewLayout'
], function (vent, AppLayout, Marionette, EditSeriesView, DeleteSeriesView, EpisodeDetailsLayout, HistoryDetailsView, LogDetailsView, RenamePreviewLayout) { ], function (vent, AppLayout, Marionette, EditSeriesView, DeleteSeriesView, EpisodeDetailsLayout, HistoryDetailsLayout, LogDetailsView, RenamePreviewLayout) {
return Marionette.AppRouter.extend({ return Marionette.AppRouter.extend({
@ -49,7 +49,7 @@ define(
}, },
_showHistory: function (options) { _showHistory: function (options) {
var view = new HistoryDetailsView({ model: options.model }); var view = new HistoryDetailsLayout({ model: options.model });
AppLayout.modalRegion.show(view); AppLayout.modalRegion.show(view);
}, },

Loading…
Cancel
Save