Added history details modal
This commit is contained in:
parent
932012d7f9
commit
1c4a687854
|
@ -1,5 +1,6 @@
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using NLog;
|
using NLog;
|
||||||
using NzbDrone.Common.Messaging;
|
using NzbDrone.Common.Messaging;
|
||||||
|
@ -89,9 +90,12 @@ namespace NzbDrone.Core.History
|
||||||
Quality = message.EpisodeFile.Quality,
|
Quality = message.EpisodeFile.Quality,
|
||||||
SourceTitle = message.EpisodeFile.Path,
|
SourceTitle = message.EpisodeFile.Path,
|
||||||
SeriesId = message.EpisodeFile.SeriesId,
|
SeriesId = message.EpisodeFile.SeriesId,
|
||||||
EpisodeId = episode.Id,
|
EpisodeId = episode.Id
|
||||||
};
|
};
|
||||||
|
|
||||||
|
history.Data.Add("Path", message.EpisodeFile.Path);
|
||||||
|
history.Data.Add("Filename", Path.GetFileNameWithoutExtension(message.EpisodeFile.Path));
|
||||||
|
|
||||||
_historyRepository.Insert(history);
|
_historyRepository.Insert(history);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
namespace NzbDrone.Core.MediaFiles.Events
|
namespace NzbDrone.Core.MediaFiles.Events
|
||||||
{
|
{
|
||||||
public class EpisodeImportedEvent:IEvent
|
public class EpisodeImportedEvent : IEvent
|
||||||
{
|
{
|
||||||
public EpisodeFile EpisodeFile { get; private set; }
|
public EpisodeFile EpisodeFile { get; private set; }
|
||||||
|
|
||||||
|
|
|
@ -48,3 +48,12 @@ td.episode-status-cell, td.quality-cell {
|
||||||
font-size: 9px;
|
font-size: 9px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.history-details-cell {
|
||||||
|
.clickable();
|
||||||
|
width: 10px;
|
||||||
|
|
||||||
|
i {
|
||||||
|
.clickable();
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,10 @@
|
||||||
|
'use strict';
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
'marionette'
|
||||||
|
], function (Marionette) {
|
||||||
|
|
||||||
|
return Marionette.ItemView.extend({
|
||||||
|
template: 'History/Details/HistoryDetailsViewTemplate'
|
||||||
|
});
|
||||||
|
});
|
|
@ -0,0 +1,58 @@
|
||||||
|
<div class="history-detail-modal">
|
||||||
|
<div class="modal-header">
|
||||||
|
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
|
||||||
|
|
||||||
|
<h3>
|
||||||
|
Details
|
||||||
|
</h3>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="modal-body">
|
||||||
|
{{#if_eq eventType compare="grabbed"}}
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
|
||||||
|
<dt>Name</dt>
|
||||||
|
<dd>{{sourceTitle}}</dd>
|
||||||
|
|
||||||
|
{{#with data}}
|
||||||
|
{{#if indexer}}
|
||||||
|
<dt>Indexer</dt>
|
||||||
|
<dd>{{indexer}}</dd>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if releaseGroup}}
|
||||||
|
<dt>Release Group</dt>
|
||||||
|
<dd>{{releaseGroup}}</dd>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if nzbInfoUrl}}
|
||||||
|
<dt>Info</dt>
|
||||||
|
<dd><a href="{{nzbInfoUrl}}">{{nzbInfoUrl}}o</a></dd>
|
||||||
|
{{/if}}
|
||||||
|
{{/with}}
|
||||||
|
</dl>
|
||||||
|
{{else}}
|
||||||
|
{{#if data}}
|
||||||
|
{{#with data}}
|
||||||
|
<dl class="dl-horizontal">
|
||||||
|
{{#if filename}}
|
||||||
|
<dt>Filename</dt>
|
||||||
|
<dd>{{filename}}</dd>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
{{#if path}}
|
||||||
|
<dt>Path</dt>
|
||||||
|
<dd>{{path}}</dd>
|
||||||
|
{{/if}}
|
||||||
|
</dl>
|
||||||
|
{{/with}}
|
||||||
|
{{else}}
|
||||||
|
No details available
|
||||||
|
{{/if}}
|
||||||
|
{{/if_eq}}
|
||||||
|
</div>
|
||||||
|
<div class="modal-footer">
|
||||||
|
<button class="btn" data-dismiss="modal">close</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
|
@ -0,0 +1,27 @@
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
define(
|
||||||
|
[
|
||||||
|
'app',
|
||||||
|
'Cells/NzbDroneCell'
|
||||||
|
], function (App, NzbDroneCell) {
|
||||||
|
return NzbDroneCell.extend({
|
||||||
|
|
||||||
|
className: 'history-details-cell',
|
||||||
|
|
||||||
|
events: {
|
||||||
|
'click': '_showDetails'
|
||||||
|
},
|
||||||
|
|
||||||
|
render: function () {
|
||||||
|
this.$el.empty();
|
||||||
|
this.$el.html('<i class="icon-info-sign"></i>');
|
||||||
|
|
||||||
|
return this;
|
||||||
|
},
|
||||||
|
|
||||||
|
_showDetails: function () {
|
||||||
|
App.vent.trigger(App.Commands.ShowHistoryDetails, { history: this.model });
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
|
@ -10,9 +10,21 @@ define(
|
||||||
'Cells/EpisodeTitleCell',
|
'Cells/EpisodeTitleCell',
|
||||||
'Cells/QualityCell',
|
'Cells/QualityCell',
|
||||||
'Cells/RelativeDateCell',
|
'Cells/RelativeDateCell',
|
||||||
|
'History/HistoryDetailsCell',
|
||||||
'Shared/Grid/Pager',
|
'Shared/Grid/Pager',
|
||||||
'Shared/LoadingView'
|
'Shared/LoadingView'
|
||||||
], function (Marionette, Backgrid, HistoryCollection, EventTypeCell, SeriesTitleCell, EpisodeNumberCell, EpisodeTitleCell, QualityCell, RelativeDateCell, GridPager, LoadingView) {
|
], function (Marionette,
|
||||||
|
Backgrid,
|
||||||
|
HistoryCollection,
|
||||||
|
EventTypeCell,
|
||||||
|
SeriesTitleCell,
|
||||||
|
EpisodeNumberCell,
|
||||||
|
EpisodeTitleCell,
|
||||||
|
QualityCell,
|
||||||
|
RelativeDateCell,
|
||||||
|
HistoryDetailsCell,
|
||||||
|
GridPager,
|
||||||
|
LoadingView) {
|
||||||
return Marionette.Layout.extend({
|
return Marionette.Layout.extend({
|
||||||
template: 'History/HistoryLayoutTemplate',
|
template: 'History/HistoryLayoutTemplate',
|
||||||
|
|
||||||
|
@ -56,6 +68,12 @@ define(
|
||||||
name : 'date',
|
name : 'date',
|
||||||
label: 'Date',
|
label: 'Date',
|
||||||
cell : RelativeDateCell
|
cell : RelativeDateCell
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name : 'this',
|
||||||
|
label : '',
|
||||||
|
cell : HistoryDetailsCell,
|
||||||
|
sortable: false
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|
|
@ -5,9 +5,9 @@ define(
|
||||||
'marionette',
|
'marionette',
|
||||||
'Series/Edit/EditSeriesView',
|
'Series/Edit/EditSeriesView',
|
||||||
'Series/Delete/DeleteSeriesView',
|
'Series/Delete/DeleteSeriesView',
|
||||||
'Episode/Layout'
|
'Episode/Layout',
|
||||||
|
'History/Details/HistoryDetailsView'
|
||||||
], function (App, Marionette, EditSeriesView, DeleteSeriesView, EpisodeLayout) {
|
], function (App, Marionette, EditSeriesView, DeleteSeriesView, EpisodeLayout, HistoryDetailsView) {
|
||||||
|
|
||||||
var router = Marionette.AppRouter.extend({
|
var router = Marionette.AppRouter.extend({
|
||||||
|
|
||||||
|
@ -16,6 +16,7 @@ define(
|
||||||
App.vent.on(App.Commands.EditSeriesCommand, this._editSeries, this);
|
App.vent.on(App.Commands.EditSeriesCommand, this._editSeries, this);
|
||||||
App.vent.on(App.Commands.DeleteSeriesCommand, this._deleteSeries, this);
|
App.vent.on(App.Commands.DeleteSeriesCommand, this._deleteSeries, this);
|
||||||
App.vent.on(App.Commands.ShowEpisodeDetails, this._showEpisode, this);
|
App.vent.on(App.Commands.ShowEpisodeDetails, this._showEpisode, this);
|
||||||
|
App.vent.on(App.Commands.ShowHistoryDetails, this._showHistory, this);
|
||||||
},
|
},
|
||||||
|
|
||||||
_closeModal: function () {
|
_closeModal: function () {
|
||||||
|
@ -35,6 +36,11 @@ define(
|
||||||
_showEpisode: function (options) {
|
_showEpisode: function (options) {
|
||||||
var view = new EpisodeLayout({ model: options.episode, hideSeriesLink: options.hideSeriesLink });
|
var view = new EpisodeLayout({ model: options.episode, hideSeriesLink: options.hideSeriesLink });
|
||||||
App.modalRegion.show(view);
|
App.modalRegion.show(view);
|
||||||
|
},
|
||||||
|
|
||||||
|
_showHistory: function (options) {
|
||||||
|
var view = new HistoryDetailsView({ model: options.history });
|
||||||
|
App.modalRegion.show(view);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -196,6 +196,7 @@ define(
|
||||||
DeleteSeriesCommand: 'DeleteSeriesCommand',
|
DeleteSeriesCommand: 'DeleteSeriesCommand',
|
||||||
CloseModalCommand : 'CloseModalCommand',
|
CloseModalCommand : 'CloseModalCommand',
|
||||||
ShowEpisodeDetails : 'ShowEpisodeDetails',
|
ShowEpisodeDetails : 'ShowEpisodeDetails',
|
||||||
|
ShowHistoryDetails : 'ShowHistryDetails',
|
||||||
SaveSettings : 'saveSettings',
|
SaveSettings : 'saveSettings',
|
||||||
ShowLogFile : 'showLogFile'
|
ShowLogFile : 'showLogFile'
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue