From 6c9ea60382d5fe0fd8da4589a872d6ad7bf4dee7 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Wed, 18 Jun 2014 23:46:04 -0700 Subject: [PATCH] Removed delete button from series lists, added refresh button New: Refresh button on series lists (replaces delete) New: Show series title on poster on hover --- src/UI/Cells/SeriesActionsCell.js | 32 +++++++++++---- .../Index/Overview/SeriesOverviewItemView.js | 24 ++--------- .../SeriesOverviewItemViewTemplate.html | 2 +- .../Index/Posters/SeriesPostersItemView.js | 32 +++++---------- .../SeriesPostersItemViewTemplate.html | 7 +++- src/UI/Series/Index/SeriesIndexItemView.js | 41 +++++++++++++++++++ src/UI/Series/series.less | 23 ++++++++++- 7 files changed, 106 insertions(+), 55 deletions(-) create mode 100644 src/UI/Series/Index/SeriesIndexItemView.js diff --git a/src/UI/Cells/SeriesActionsCell.js b/src/UI/Cells/SeriesActionsCell.js index 313f8ef29..066fea0fa 100644 --- a/src/UI/Cells/SeriesActionsCell.js +++ b/src/UI/Cells/SeriesActionsCell.js @@ -3,25 +3,38 @@ define( [ 'vent', - 'Cells/NzbDroneCell' - ], function (vent, NzbDroneCell) { + 'Cells/NzbDroneCell', + 'Commands/CommandController' + ], function (vent, NzbDroneCell, CommandController) { return NzbDroneCell.extend({ className: 'series-actions-cell', + ui: { + refresh: '.x-refresh' + }, + events: { - 'click .x-edit-series' : '_editSeries', - 'click .x-remove-series': '_removeSeries' + 'click .x-edit' : '_editSeries', + 'click .x-refresh' : '_refreshSeries' }, render: function () { this.$el.empty(); this.$el.html( - ' ' + - '' + ' ' + + '' ); + CommandController.bindToCommand({ + element: this.$el.find('.x-refresh'), + command: { + name : 'refreshSeries', + seriesId : this.model.get('id') + } + }); + this.delegateEvents(); return this; }, @@ -30,8 +43,11 @@ define( vent.trigger(vent.Commands.EditSeriesCommand, {series:this.model}); }, - _removeSeries: function () { - vent.trigger(vent.Commands.DeleteSeriesCommand, {series:this.model}); + _refreshSeries: function () { + CommandController.Execute('refreshSeries', { + name : 'refreshSeries', + seriesId: this.model.id + }); } }); }); diff --git a/src/UI/Series/Index/Overview/SeriesOverviewItemView.js b/src/UI/Series/Index/Overview/SeriesOverviewItemView.js index 1c4970a65..729723ab1 100644 --- a/src/UI/Series/Index/Overview/SeriesOverviewItemView.js +++ b/src/UI/Series/Index/Overview/SeriesOverviewItemView.js @@ -3,26 +3,10 @@ define( [ 'vent', - 'marionette' - ], function (vent, Marionette) { - return Marionette.ItemView.extend({ + 'marionette', + 'Series/Index/SeriesIndexItemView' + ], function (vent, Marionette, SeriesIndexItemView) { + return SeriesIndexItemView.extend({ template: 'Series/Index/Overview/SeriesOverviewItemViewTemplate', - - ui: { - 'progressbar': '.progress .bar' - }, - - events: { - 'click .x-edit' : 'editSeries', - 'click .x-remove': 'removeSeries' - }, - - editSeries: function () { - vent.trigger(vent.Commands.EditSeriesCommand, {series: this.model}); - }, - - removeSeries: function () { - vent.trigger(vent.Commands.DeleteSeriesCommand, {series: this.model}); - } }); }); diff --git a/src/UI/Series/Index/Overview/SeriesOverviewItemViewTemplate.html b/src/UI/Series/Index/Overview/SeriesOverviewItemViewTemplate.html index a43ee6b6e..3b9ddf3c1 100644 --- a/src/UI/Series/Index/Overview/SeriesOverviewItemViewTemplate.html +++ b/src/UI/Series/Index/Overview/SeriesOverviewItemViewTemplate.html @@ -14,8 +14,8 @@
+ -
diff --git a/src/UI/Series/Index/Posters/SeriesPostersItemView.js b/src/UI/Series/Index/Posters/SeriesPostersItemView.js index 997c1c9e1..e72cb6a4b 100644 --- a/src/UI/Series/Index/Posters/SeriesPostersItemView.js +++ b/src/UI/Series/Index/Posters/SeriesPostersItemView.js @@ -3,37 +3,25 @@ define( [ 'vent', - 'marionette' - ], function (vent, Marionette) { + 'marionette', + 'Series/Index/SeriesIndexItemView' + ], function (vent, Marionette, SeriesIndexItemView) { - return Marionette.ItemView.extend({ + return SeriesIndexItemView.extend({ tagName : 'li', template: 'Series/Index/Posters/SeriesPostersItemViewTemplate', + initialize: function () { + this.events['mouseenter .x-series-poster'] = 'posterHoverAction'; + this.events['mouseleave .x-series-poster'] = 'posterHoverAction'; - ui: { - 'progressbar': '.progress .bar', - 'controls' : '.series-controls' - }, - - events: { - 'click .x-edit' : 'editSeries', - 'click .x-remove' : 'removeSeries', - 'mouseenter .x-series-poster': 'posterHoverAction', - 'mouseleave .x-series-poster': 'posterHoverAction' - }, - - - editSeries: function () { - vent.trigger(vent.Commands.EditSeriesCommand, {series:this.model}); - }, - - removeSeries: function () { - vent.trigger(vent.Commands.DeleteSeriesCommand, {series:this.model}); + this.ui.controls = '.x-series-controls'; + this.ui.title = '.x-title'; }, posterHoverAction: function () { this.ui.controls.slideToggle(); + this.ui.title.slideToggle(); } }); }); diff --git a/src/UI/Series/Index/Posters/SeriesPostersItemViewTemplate.html b/src/UI/Series/Index/Posters/SeriesPostersItemViewTemplate.html index bf3de36b8..f1b82fc52 100644 --- a/src/UI/Series/Index/Posters/SeriesPostersItemViewTemplate.html +++ b/src/UI/Series/Index/Posters/SeriesPostersItemViewTemplate.html @@ -1,9 +1,9 @@ 
-
+
+ -
{{#unless_eq status compare="continuing"}}
Ended
@@ -12,6 +12,9 @@
{{title}}
+
+ {{title}} +
diff --git a/src/UI/Series/Index/SeriesIndexItemView.js b/src/UI/Series/Index/SeriesIndexItemView.js new file mode 100644 index 000000000..9513ac588 --- /dev/null +++ b/src/UI/Series/Index/SeriesIndexItemView.js @@ -0,0 +1,41 @@ +'use strict'; + +define( + [ + 'vent', + 'marionette', + 'Commands/CommandController' + ], function (vent, Marionette, CommandController) { + return Marionette.ItemView.extend({ + + ui: { + refresh : '.x-refresh' + }, + + events: { + 'click .x-edit' : '_editSeries', + 'click .x-refresh' : '_refreshSeries' + }, + + onRender: function () { + CommandController.bindToCommand({ + element: this.ui.refresh, + command: { + name : 'refreshSeries', + seriesId : this.model.get('id') + } + }); + }, + + _editSeries: function () { + vent.trigger(vent.Commands.EditSeriesCommand, {series: this.model}); + }, + + _refreshSeries: function () { + CommandController.Execute('refreshSeries', { + name : 'refreshSeries', + seriesId: this.model.id + }); + } + }); + }); diff --git a/src/UI/Series/series.less b/src/UI/Series/series.less index e6b32703c..1420fe73e 100644 --- a/src/UI/Series/series.less +++ b/src/UI/Series/series.less @@ -188,7 +188,22 @@ background-color : #eeeeee; width : 100%; text-align : right; - padding-right : 20px; + padding-right : 10px; + .opacity(0.8); + display : none; + + i { + .clickable(); + } + } + + .hidden-title { + position : absolute;; + bottom : 0px; + overflow : hidden; + background-color : #eeeeee; + width : 100%; + text-align : center; .opacity(0.8); display : none; } @@ -279,7 +294,7 @@ text-transform : none; i { - .clickable; + .clickable(); font-size : 24px; padding-left : 5px; } @@ -340,6 +355,10 @@ .series-overview-list-actions { min-width: 56px; max-width: 56px; + + i { + .clickable(); + } } //Editor