diff --git a/UI/Series/Index/List/ItemView.js b/UI/Series/Index/List/ItemView.js index 536945110..de79fe4da 100644 --- a/UI/Series/Index/List/ItemView.js +++ b/UI/Series/Index/List/ItemView.js @@ -10,7 +10,6 @@ define([ ], function () { NzbDrone.Series.Index.List.ItemView = Backbone.Marionette.ItemView.extend({ - tagName : 'tr', template: 'Series/Index/List/ItemTemplate', ui: { diff --git a/UI/Series/Index/Posters/CollectionTemplate.html b/UI/Series/Index/Posters/CollectionTemplate.html new file mode 100644 index 000000000..a09e98ac6 --- /dev/null +++ b/UI/Series/Index/Posters/CollectionTemplate.html @@ -0,0 +1,5 @@ +
+
+ +
+
\ No newline at end of file diff --git a/UI/Series/Index/Posters/CollectionView.js b/UI/Series/Index/Posters/CollectionView.js new file mode 100644 index 000000000..c652e1017 --- /dev/null +++ b/UI/Series/Index/Posters/CollectionView.js @@ -0,0 +1,17 @@ +'use strict'; + +define(['app', 'Quality/QualityProfileCollection', 'Series/Index/Posters/ItemView', 'Config'], function (app, qualityProfileCollection) { + + NzbDrone.Series.Index.Posters.CollectionView = Backbone.Marionette.CompositeView.extend({ + itemView : NzbDrone.Series.Index.Posters.ItemView, + itemViewContainer : '#x-series-posters', + template : 'Series/Index/Posters/CollectionTemplate', + qualityProfileCollection: qualityProfileCollection, + + initialize: function () { + this.qualityProfileCollection.fetch(); + + this.itemViewOptions = { qualityProfiles: this.qualityProfileCollection }; + } + }); +}); \ No newline at end of file diff --git a/UI/Series/Index/Posters/ItemTemplate.html b/UI/Series/Index/Posters/ItemTemplate.html new file mode 100644 index 000000000..3826996d5 --- /dev/null +++ b/UI/Series/Index/Posters/ItemTemplate.html @@ -0,0 +1,29 @@ +
+
+
+ + + + +
{{title}}
+ +
+ {{#if isContinuing}} + {{#if bestDateString}} + {{bestDateString}} + {{else}} + {{statusText}} + {{/if}} + Season {{seasonCount}} + {{else}} + {{seasonCount}} Seasons + {{/if}} +
+ + + + + +
+
+
\ No newline at end of file diff --git a/UI/Series/Index/Posters/ItemView.js b/UI/Series/Index/Posters/ItemView.js new file mode 100644 index 000000000..8891250ba --- /dev/null +++ b/UI/Series/Index/Posters/ItemView.js @@ -0,0 +1,45 @@ +'use strict'; + +define([ + 'app', + 'Quality/QualityProfileCollection', + 'Series/SeriesCollection', + 'Series/Edit/EditSeriesView', + 'Series/Delete/DeleteSeriesView' + +], function () { + + NzbDrone.Series.Index.Posters.ItemView = Backbone.Marionette.ItemView.extend({ + tagName : 'li', + template: 'Series/Index/Posters/ItemTemplate', + + + ui: { + 'progressbar': '.progress .bar' + }, + + events: { + 'click .x-edit' : 'editSeries', + 'click .x-remove': 'removeSeries' + }, + + initialize: function (options) { + this.qualityProfileCollection = options.qualityProfiles; + }, + + editSeries: function () { + var view = new NzbDrone.Series.Edit.EditSeriesView({ model: this.model}); + + NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, { + view: view + }); + }, + + removeSeries: function () { + var view = new NzbDrone.Series.Delete.DeleteSeriesView({ model: this.model }); + NzbDrone.vent.trigger(NzbDrone.Events.OpenModalDialog, { + view: view + }); + } + }); +}); diff --git a/UI/Series/Index/SeriesIndexLayout.js b/UI/Series/Index/SeriesIndexLayout.js index 4567c480f..1a3a49b9a 100644 --- a/UI/Series/Index/SeriesIndexLayout.js +++ b/UI/Series/Index/SeriesIndexLayout.js @@ -2,6 +2,7 @@ define([ 'app', 'Series/Index/List/CollectionView', + 'Series/Index/Posters/CollectionView', 'Series/Index/EmptyView', 'Config', 'Series/Index/Table/AirDateCell', @@ -100,6 +101,10 @@ define([ this.series.show(new NzbDrone.Series.Index.List.CollectionView({ collection: this.seriesCollection })); }, + showPosters: function () { + this.series.show(new NzbDrone.Series.Index.Posters.CollectionView({ collection: this.seriesCollection })); + }, + showEmpty: function () { this.series.show(new NzbDrone.Series.Index.EmptyView()); }, @@ -120,6 +125,9 @@ define([ case 1: this.showList(); break; + case 2: + this.showPosters(); + break; default: this.showTable(); } @@ -143,6 +151,11 @@ define([ this.showList(); } + else if (view === 2) { + NzbDrone.Config.SeriesViewStyle(2); + this.showPosters(); + } + else { NzbDrone.Config.SeriesViewStyle(0); this.showTable(); diff --git a/UI/Series/Index/SeriesIndexLayoutTemplate.html b/UI/Series/Index/SeriesIndexLayoutTemplate.html index 207375303..4fb81b4ed 100644 --- a/UI/Series/Index/SeriesIndexLayoutTemplate.html +++ b/UI/Series/Index/SeriesIndexLayoutTemplate.html @@ -6,6 +6,7 @@
+
diff --git a/UI/Series/series.less b/UI/Series/series.less index a7af3ed93..7a797d2ab 100644 --- a/UI/Series/series.less +++ b/UI/Series/series.less @@ -4,4 +4,29 @@ h2 { margin-top: 0px; } +} + +.series-posters { + list-style-type: none; + + li { + display: inline-block; + vertical-align: top; + } +} + +.series-posters-item { + margin-bottom: 20px; + + .center { + display: block; + margin-left:auto; + margin-right:auto; + text-align: center; + } + + .progress { + left: 22px; + margin-top: 5px; + } } \ No newline at end of file diff --git a/UI/app.js b/UI/app.js index eabbaea3a..b491f41aa 100644 --- a/UI/app.js +++ b/UI/app.js @@ -32,7 +32,9 @@ define('app', function () { window.NzbDrone.Config = {}; window.NzbDrone.Series = {}; window.NzbDrone.Series.Index = {}; + window.NzbDrone.Series.Index.Table = {}; window.NzbDrone.Series.Index.List = {}; + window.NzbDrone.Series.Index.Posters = {}; window.NzbDrone.Series.Edit = {}; window.NzbDrone.Series.Delete = {}; window.NzbDrone.Series.Details = {};