mirror of
https://github.com/Sonarr/Sonarr.git
synced 2024-12-16 11:37:58 +02:00
New: Details for import/grab on Episode Activity tab
This commit is contained in:
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 {
|
||||
width : 56px;
|
||||
min-width : 56px;
|
||||
|
35
src/UI/Episode/Activity/EpisodeActivityDetailsCell.js
Normal file
35
src/UI/Episode/Activity/EpisodeActivityDetailsCell.js
Normal file
@ -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/RelativeDateCell',
|
||||
'Episode/Activity/EpisodeActivityActionsCell',
|
||||
'Episode/Activity/EpisodeActivityDetailsCell',
|
||||
'Episode/Activity/NoActivityView',
|
||||
'Shared/LoadingView'
|
||||
], function (Marionette,
|
||||
@ -17,6 +18,7 @@ define(
|
||||
QualityCell,
|
||||
RelativeDateCell,
|
||||
EpisodeActivityActionsCell,
|
||||
EpisodeActivityDetailsCell,
|
||||
NoActivityView,
|
||||
LoadingView) {
|
||||
|
||||
@ -50,6 +52,12 @@ define(
|
||||
label: 'Date',
|
||||
cell : RelativeDateCell
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : '',
|
||||
cell : EpisodeActivityDetailsCell,
|
||||
sortable: false
|
||||
},
|
||||
{
|
||||
name : 'this',
|
||||
label : '',
|
||||
|
40
src/UI/History/Details/HistoryDetailsLayout.js
Normal file
40
src/UI/History/Details/HistoryDetailsLayout.js
Normal file
@ -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);
|
||||
}
|
||||
});
|
||||
});
|
23
src/UI/History/Details/HistoryDetailsLayoutTemplate.html
Normal file
23
src/UI/History/Details/HistoryDetailsLayoutTemplate.html
Normal file
@ -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">×</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';
|
||||
define(
|
||||
[
|
||||
'jquery',
|
||||
'vent',
|
||||
'marionette',
|
||||
'History/Details/HistoryDetailsAge'
|
||||
], function ($, vent, Marionette) {
|
||||
], function (Marionette) {
|
||||
|
||||
return Marionette.ItemView.extend({
|
||||
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);
|
||||
}
|
||||
template: 'History/Details/HistoryDetailsViewTemplate'
|
||||
});
|
||||
});
|
||||
|
@ -1,93 +1,71 @@
|
||||
<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">×</button>
|
||||
{{#if_eq eventType compare="grabbed"}}
|
||||
<dl class="dl-horizontal">
|
||||
|
||||
<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>
|
||||
<dt>Name:</dt>
|
||||
<dd>{{sourceTitle}}</dd>
|
||||
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
{{#if_eq eventType compare="grabbed"}}
|
||||
<dl class="dl-horizontal">
|
||||
{{#with data}}
|
||||
{{#if indexer}}
|
||||
<dt>Indexer:</dt>
|
||||
<dd>{{indexer}}</dd>
|
||||
{{/if}}
|
||||
|
||||
<dt>Name:</dt>
|
||||
<dd>{{sourceTitle}}</dd>
|
||||
{{#if releaseGroup}}
|
||||
<dt>Release Group:</dt>
|
||||
<dd>{{releaseGroup}}</dd>
|
||||
{{/if}}
|
||||
|
||||
{{#with data}}
|
||||
{{#if indexer}}
|
||||
<dt>Indexer:</dt>
|
||||
<dd>{{indexer}}</dd>
|
||||
{{/if}}
|
||||
{{#if nzbInfoUrl}}
|
||||
<dt>Info:</dt>
|
||||
<dd><a href="{{nzbInfoUrl}}">{{nzbInfoUrl}}</a></dd>
|
||||
{{/if}}
|
||||
|
||||
{{#if releaseGroup}}
|
||||
<dt>Release Group:</dt>
|
||||
<dd>{{releaseGroup}}</dd>
|
||||
{{/if}}
|
||||
{{#if downloadClient}}
|
||||
<dt>Download Client:</dt>
|
||||
<dd>{{downloadClient}}</dd>
|
||||
{{/if}}
|
||||
|
||||
{{#if nzbInfoUrl}}
|
||||
<dt>Info:</dt>
|
||||
<dd><a href="{{nzbInfoUrl}}">{{nzbInfoUrl}}</a></dd>
|
||||
{{/if}}
|
||||
{{#if downloadClientId}}
|
||||
<dt>Download Client ID:</dt>
|
||||
<dd>{{downloadClientId}}</dd>
|
||||
{{/if}}
|
||||
|
||||
{{#if downloadClient}}
|
||||
<dt>Download Client:</dt>
|
||||
<dd>{{downloadClient}}</dd>
|
||||
{{/if}}
|
||||
{{#if age}}
|
||||
{{historyAge}}
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
</dl>
|
||||
{{/if_eq}}
|
||||
{{#if_eq eventType compare="downloadFailed"}}
|
||||
<dl class="dl-horizontal">
|
||||
|
||||
{{#if downloadClientId}}
|
||||
<dt>Download Client ID:</dt>
|
||||
<dd>{{downloadClientId}}</dd>
|
||||
{{/if}}
|
||||
<dt>Name:</dt>
|
||||
<dd>{{sourceTitle}}</dd>
|
||||
|
||||
{{#if age}}
|
||||
{{historyAge}}
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
</dl>
|
||||
{{/if_eq}}
|
||||
{{#if_eq eventType compare="downloadFailed"}}
|
||||
<dl class="dl-horizontal">
|
||||
{{#with data}}
|
||||
<dt>Message:</dt>
|
||||
<dd>{{message}}</dd>
|
||||
{{/with}}
|
||||
</dl>
|
||||
{{/if_eq}}
|
||||
{{#if_eq eventType compare="downloadFolderImported"}}
|
||||
<dl class="dl-horizontal">
|
||||
|
||||
<dt>Name:</dt>
|
||||
<dd>{{sourceTitle}}</dd>
|
||||
{{#if sourceTitle}}
|
||||
<dt>Name:</dt>
|
||||
<dd>{{sourceTitle}}</dd>
|
||||
{{/if}}
|
||||
|
||||
{{#with data}}
|
||||
<dt>Message:</dt>
|
||||
<dd>{{message}}</dd>
|
||||
{{/with}}
|
||||
</dl>
|
||||
{{/if_eq}}
|
||||
{{#if_eq eventType compare="downloadFolderImported"}}
|
||||
<dl class="dl-horizontal">
|
||||
{{#with data}}
|
||||
{{#if droppedPath}}
|
||||
<dt>Source:</dt>
|
||||
<dd>{{droppedPath}}</dd>
|
||||
{{/if}}
|
||||
|
||||
{{#if sourceTitle}}
|
||||
<dt>Name:</dt>
|
||||
<dd>{{sourceTitle}}</dd>
|
||||
{{/if}}
|
||||
|
||||
{{#with data}}
|
||||
{{#if droppedPath}}
|
||||
<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>
|
||||
{{#if importedPath}}
|
||||
<dt>Imported To:</dt>
|
||||
<dd>{{importedPath}}</dd>
|
||||
{{/if}}
|
||||
{{/with}}
|
||||
</dl>
|
||||
{{/if_eq}}
|
@ -266,6 +266,10 @@
|
||||
margin-top : 30px;
|
||||
font-size : 12px;
|
||||
}
|
||||
|
||||
.episode-activity-details-cell .popover {
|
||||
max-width: 800px;
|
||||
}
|
||||
}
|
||||
|
||||
.season-grid {
|
||||
|
@ -7,10 +7,10 @@ define(
|
||||
'Series/Edit/EditSeriesView',
|
||||
'Series/Delete/DeleteSeriesView',
|
||||
'Episode/EpisodeDetailsLayout',
|
||||
'History/Details/HistoryDetailsView',
|
||||
'History/Details/HistoryDetailsLayout',
|
||||
'System/Logs/Table/Details/LogDetailsView',
|
||||
'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({
|
||||
|
||||
@ -49,7 +49,7 @@ define(
|
||||
},
|
||||
|
||||
_showHistory: function (options) {
|
||||
var view = new HistoryDetailsView({ model: options.model });
|
||||
var view = new HistoryDetailsLayout({ model: options.model });
|
||||
AppLayout.modalRegion.show(view);
|
||||
},
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user