mirror of
https://github.com/Radarr/Radarr.git
synced 2026-04-17 21:26:22 -04:00
Episode Activity added
New: Activity tab added to Episode Details
This commit is contained in:
@@ -35,7 +35,7 @@ define(
|
||||
|
||||
}
|
||||
|
||||
this.$el.html('<i class="{0}" title="{1}"/>'.format(icon, toolTip));
|
||||
this.$el.html('<i class="{0}" title="{1}" data-placement="right"/>'.format(icon, toolTip));
|
||||
}
|
||||
|
||||
return this;
|
||||
31
src/UI/Episode/Activity/EpisodeActivityCollection.js
Normal file
31
src/UI/Episode/Activity/EpisodeActivityCollection.js
Normal file
@@ -0,0 +1,31 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone',
|
||||
'Episode/Activity/EpisodeActivityModel'
|
||||
], function (Backbone, EpisodeActivityModel) {
|
||||
return Backbone.Collection.extend({
|
||||
url : window.NzbDrone.ApiRoot + '/episodes/activity',
|
||||
model: EpisodeActivityModel,
|
||||
|
||||
originalFetch: Backbone.Collection.prototype.fetch,
|
||||
|
||||
initialize: function (options) {
|
||||
this.episodeId = options.episodeId;
|
||||
},
|
||||
|
||||
fetch: function (options) {
|
||||
if (!this.episodeId) {
|
||||
throw 'episodeId is required';
|
||||
}
|
||||
|
||||
if (!options) {
|
||||
options = {};
|
||||
}
|
||||
|
||||
options.data = { episodeId: this.episodeId };
|
||||
|
||||
return this.originalFetch.call(this, options);
|
||||
}
|
||||
});
|
||||
});
|
||||
72
src/UI/Episode/Activity/EpisodeActivityLayout.js
Normal file
72
src/UI/Episode/Activity/EpisodeActivityLayout.js
Normal file
@@ -0,0 +1,72 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'app',
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'Episode/Activity/EpisodeActivityCollection',
|
||||
'Cells/EventTypeCell',
|
||||
'Cells/QualityCell',
|
||||
'Cells/RelativeDateCell',
|
||||
'Shared/LoadingView'
|
||||
], function (App, Marionette, Backgrid, EpisodeActivityCollection, EventTypeCell, QualityCell, RelativeDateCell, LoadingView) {
|
||||
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Episode/Activity/EpisodeActivityLayoutTemplate',
|
||||
|
||||
regions: {
|
||||
activityTable: '.activity-table'
|
||||
},
|
||||
|
||||
columns:
|
||||
[
|
||||
{
|
||||
name : 'eventType',
|
||||
label : '',
|
||||
cell : EventTypeCell,
|
||||
cellValue: 'this'
|
||||
},
|
||||
{
|
||||
name : 'sourceTitle',
|
||||
label: 'Source Title',
|
||||
cell : 'string'
|
||||
},
|
||||
{
|
||||
name : 'quality',
|
||||
label: 'Quality',
|
||||
cell : QualityCell
|
||||
},
|
||||
{
|
||||
name : 'date',
|
||||
label: 'Date',
|
||||
cell : RelativeDateCell
|
||||
}
|
||||
],
|
||||
|
||||
initialize: function (options) {
|
||||
this.model = options.model;
|
||||
this.series = options.series;
|
||||
|
||||
this.collection = new EpisodeActivityCollection({ episodeId: this.model.id });
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
var self = this;
|
||||
this.activityTable.show(new LoadingView());
|
||||
|
||||
var promise = this.collection.fetch();
|
||||
|
||||
promise.done(function () {
|
||||
self._showTable();
|
||||
});
|
||||
},
|
||||
|
||||
_showTable: function () {
|
||||
this.activityTable.show(new Backgrid.Grid({
|
||||
collection: this.collection,
|
||||
columns : this.columns,
|
||||
className : 'table table-hover table-condensed'
|
||||
}));
|
||||
}
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1 @@
|
||||
<div class="activity-table"></div>
|
||||
9
src/UI/Episode/Activity/EpisodeActivityModel.js
Normal file
9
src/UI/Episode/Activity/EpisodeActivityModel.js
Normal file
@@ -0,0 +1,9 @@
|
||||
'use strict';
|
||||
define(
|
||||
[
|
||||
'backbone'
|
||||
], function (Backbone) {
|
||||
return Backbone.Model.extend({
|
||||
|
||||
});
|
||||
});
|
||||
@@ -4,8 +4,9 @@ define(
|
||||
'marionette',
|
||||
'Episode/Summary/EpisodeSummaryLayout',
|
||||
'Episode/Search/EpisodeSearchLayout',
|
||||
'Episode/Activity/EpisodeActivityLayout',
|
||||
'Series/SeriesCollection'
|
||||
], function (Marionette, SummaryLayout, SearchLayout, SeriesCollection) {
|
||||
], function (Marionette, SummaryLayout, SearchLayout, EpisodeActivityLayout, SeriesCollection) {
|
||||
|
||||
return Marionette.Layout.extend({
|
||||
template: 'Episode/EpisodeDetailsLayoutTemplate',
|
||||
@@ -38,7 +39,7 @@ define(
|
||||
|
||||
this.series = SeriesCollection.find({ id: this.model.get('seriesId') });
|
||||
this.templateHelpers.series = this.series.toJSON();
|
||||
this.openingTab = options.openingTab || 'summary'
|
||||
this.openingTab = options.openingTab || 'summary';
|
||||
},
|
||||
|
||||
onShow: function () {
|
||||
@@ -71,6 +72,7 @@ define(
|
||||
}
|
||||
|
||||
this.ui.activity.tab('show');
|
||||
this.activity.show(new EpisodeActivityLayout({model: this.model, series: this.series}));
|
||||
},
|
||||
|
||||
_showSearch: function (e) {
|
||||
|
||||
@@ -15,12 +15,12 @@
|
||||
<div class="modal-body">
|
||||
<ul class="nav nav-tabs" id="myTab">
|
||||
<li><a href="#episode-summary" class="x-episode-summary">Summary</a></li>
|
||||
<!-- <li><a href="#episode-activity" class="x-episode-activity">Activity</a></li>-->
|
||||
<li><a href="#episode-activity" class="x-episode-activity">Activity</a></li>
|
||||
<li><a href="#episode-search" class="x-episode-search">Search</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane" id="episode-summary"/>
|
||||
<!--<div class="tab-pane" id="episode-activity"/>-->
|
||||
<div class="tab-pane" id="episode-activity"/>
|
||||
<div class="tab-pane" id="episode-search"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -58,7 +58,7 @@ define(
|
||||
if (App.reqres.hasHandler(App.Reqres.GetEpisodeFileById)) {
|
||||
var episodeFile = App.request(App.Reqres.GetEpisodeFileById, episodeFileId);
|
||||
var episodeFileCollection = new EpisodeFileCollection(episodeFile, { seriesId: this.model.get('seriesId') });
|
||||
this._showTable(episodeFileCollection)
|
||||
this._showTable(episodeFileCollection);
|
||||
}
|
||||
|
||||
else {
|
||||
|
||||
@@ -4,7 +4,7 @@ define(
|
||||
'marionette',
|
||||
'backgrid',
|
||||
'History/HistoryCollection',
|
||||
'History/Table/EventTypeCell',
|
||||
'Cells/EventTypeCell',
|
||||
'Cells/SeriesTitleCell',
|
||||
'Cells/EpisodeNumberCell',
|
||||
'Cells/EpisodeTitleCell',
|
||||
|
||||
Reference in New Issue
Block a user