diff --git a/UI/Content/base.less b/UI/Content/base.less index 54cc3263f..b6dbe0b50 100644 --- a/UI/Content/base.less +++ b/UI/Content/base.less @@ -72,3 +72,9 @@ html { text-align: center; padding: 30px; } + + +.page-toolbar{ + margin-top: 10px; + margin-bottom: 30px; +} diff --git a/UI/Series/Delete/DeleteSeriesView.js b/UI/Series/Delete/DeleteSeriesView.js index 95fe9e0eb..1a9243615 100644 --- a/UI/Series/Delete/DeleteSeriesView.js +++ b/UI/Series/Delete/DeleteSeriesView.js @@ -1,5 +1,4 @@ 'use strict'; - define(['app', 'Series/SeriesModel'], function () { NzbDrone.Series.Delete.DeleteSeriesView = Backbone.Marionette.ItemView.extend({ @@ -30,4 +29,4 @@ define(['app', 'Series/SeriesModel'], function () { } }); -}); \ No newline at end of file +}); diff --git a/UI/Series/EpisodeCollection.js b/UI/Series/EpisodeCollection.js index 37c039896..7312b7806 100644 --- a/UI/Series/EpisodeCollection.js +++ b/UI/Series/EpisodeCollection.js @@ -1,6 +1,7 @@ -define(['app', 'Series/EpisodeModel'], function () { +"use strict"; +define(['app', 'Series/EpisodeModel'], function () { NzbDrone.Series.EpisodeCollection = Backbone.Collection.extend({ url : NzbDrone.Constants.ApiRoot + '/episodes', model: NzbDrone.Series.EpisodeModel }); -}); \ No newline at end of file +}); diff --git a/UI/Series/EpisodeModel.js b/UI/Series/EpisodeModel.js index c0cdf2681..5e8f8b7a7 100644 --- a/UI/Series/EpisodeModel.js +++ b/UI/Series/EpisodeModel.js @@ -1,3 +1,4 @@ +"use strict"; define(['app'], function () { NzbDrone.Series.EpisodeModel = Backbone.Model.extend({ diff --git a/UI/Series/Index/EmptySeriesIndexView.js b/UI/Series/Index/EmptySeriesIndexView.js new file mode 100644 index 000000000..d6c6154d4 --- /dev/null +++ b/UI/Series/Index/EmptySeriesIndexView.js @@ -0,0 +1,6 @@ +'use strict'; +define(['app'], function () { + NzbDrone.Series.Index.EmptySeriesCollectionView = Backbone.Marionette.CompositeView.extend({ + template: 'Series/Index/EmptySeriesIndexTemplate' + }); +}); diff --git a/UI/Series/Index/SeriesIndexLayout.js b/UI/Series/Index/SeriesIndexLayout.js index 486ca545e..fac745a6c 100644 --- a/UI/Series/Index/SeriesIndexLayout.js +++ b/UI/Series/Index/SeriesIndexLayout.js @@ -2,6 +2,7 @@ define([ 'app', 'Series/Index/List/CollectionView', +<<<<<<< HEAD 'Config' 'Series/Index/Posters/CollectionView', 'Series/Index/EmptyView', @@ -9,6 +10,9 @@ define([ 'Series/Index/Table/AirDateCell', 'Series/Index/Table/SeriesStatusCell' 'Shared/Toolbar/ToolbarView', +======= + 'Shared/Toolbar/ToolbarLayout', +>>>>>>> added support for multi-button groups to toolbar 'Config' ], function () { @@ -180,13 +184,19 @@ define([ onShow: function () { - var commands = new NzbDrone.Shared.Toolbar.CommandCollection(); + var menuLeft = new NzbDrone.Shared.Toolbar.CommandCollection(); - commands.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "Add Series", icon: "icon-plus"})); - commands.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "RSS Sync", icon: "icon-rss"})); - commands.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "Sync Database", icon: "icon-refresh"})); + menuLeft.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "Add Series", icon: "icon-plus"})); + menuLeft.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "RSS Sync", icon: "icon-rss"})); + menuLeft.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "Sync Database", icon: "icon-refresh"})); - this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarView({collection: commands})); + var menuRight = new NzbDrone.Shared.Toolbar.CommandCollection(); + + menuRight.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "Add Series", icon: "icon-plus"})); + menuRight.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "RSS Sync", icon: "icon-rss"})); + menuRight.add(new NzbDrone.Shared.Toolbar.CommandModel({title: "Sync Database", icon: "icon-refresh"})); + + this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarLayout({left: [ menuLeft], right: [menuRight]})); switch (this.viewStyle) { case 1: diff --git a/UI/Series/SeasonCollection.js b/UI/Series/SeasonCollection.js index 8207589ed..3886d09f0 100644 --- a/UI/Series/SeasonCollection.js +++ b/UI/Series/SeasonCollection.js @@ -1,4 +1,5 @@ -define(['app', 'Series/SeasonModel'], function () { +"use strict"; +define(['app', 'Series/SeasonModel'], function () { NzbDrone.Series.SeasonCollection = Backbone.Collection.extend({ url : NzbDrone.Constants.ApiRoot + '/season', model: NzbDrone.Series.SeasonModel diff --git a/UI/Shared/Toolbar/ButtonGroupView.js b/UI/Shared/Toolbar/ButtonGroupView.js new file mode 100644 index 000000000..429d1613f --- /dev/null +++ b/UI/Shared/Toolbar/ButtonGroupView.js @@ -0,0 +1,11 @@ +"use strict"; +define(['app', 'Shared/Toolbar/CommandView'], function () { + NzbDrone.Shared.Toolbar.ButtonGroupView = Backbone.Marionette.CollectionView.extend({ + className: 'btn-group', + itemView : NzbDrone.Shared.Toolbar.CommandView + }); +}); + + + + diff --git a/UI/Shared/Toolbar/CommandTemplate.html b/UI/Shared/Toolbar/CommandTemplate.html new file mode 100644 index 000000000..d49aaa9d4 --- /dev/null +++ b/UI/Shared/Toolbar/CommandTemplate.html @@ -0,0 +1 @@ + {{title}} diff --git a/UI/Shared/Toolbar/CommandView.js b/UI/Shared/Toolbar/CommandView.js new file mode 100644 index 000000000..2ac06094b --- /dev/null +++ b/UI/Shared/Toolbar/CommandView.js @@ -0,0 +1,21 @@ +"use strict"; +define(['app'], function () { + + NzbDrone.Shared.Toolbar.CommandView = Backbone.Marionette.ItemView.extend({ + template : 'Shared/Toolbar/CommandTemplate', + className: 'btn', + + events: { + 'click': 'onClick' + }, + + onClick: function () { + window.alert('click'); + } + + }); +}); + + + + diff --git a/UI/Shared/Toolbar/ToolbarLayout.js b/UI/Shared/Toolbar/ToolbarLayout.js new file mode 100644 index 000000000..46cecd9a8 --- /dev/null +++ b/UI/Shared/Toolbar/ToolbarLayout.js @@ -0,0 +1,40 @@ +"use strict"; +define(['app', 'Shared/Toolbar/ButtonGroupView','Shared/Toolbar/CommandCollection'], function () { + NzbDrone.Shared.Toolbar.ToolbarLayout = Backbone.Marionette.Layout.extend({ + template: 'Shared/Toolbar/ToolbarLayoutTemplate', + + regions: { + left_1 : '.x-toolbar-left-1', + left_2 : '.x-toolbar-left-2', + right_1: '.x-toolbar-right-1', + right_2: '.x-toolbar-right-2' + }, + + initialize: function (options) { + this.left = options.left; + this.right = options.right; + }, + + onShow: function () { + if (this.left) { + _.each(this.left, this._showToolbarLeft, this); + } + if (this.right) { + _.each(this.right, this._showToolbarRight, this); + } + }, + + _showToolbarLeft: function (element, index) { + this['left_' + (index + 1).toString()].show(new NzbDrone.Shared.Toolbar.ButtonGroupView({collection: element})); + }, + + _showToolbarRight: function (element, index) { + this['right_' + (index + 1).toString()].show(new NzbDrone.Shared.Toolbar.ButtonGroupView({collection: element})); + } + }); + +}); + + + + diff --git a/UI/Shared/Toolbar/ToolbarLayoutTemplate.html b/UI/Shared/Toolbar/ToolbarLayoutTemplate.html new file mode 100644 index 000000000..e0e28a5a3 --- /dev/null +++ b/UI/Shared/Toolbar/ToolbarLayoutTemplate.html @@ -0,0 +1,8 @@ +
+
+
+
+
+
+
+
diff --git a/UI/Shared/Toolbar/ToolbarTemplate.html b/UI/Shared/Toolbar/ToolbarTemplate.html deleted file mode 100644 index 856f5d4b5..000000000 --- a/UI/Shared/Toolbar/ToolbarTemplate.html +++ /dev/null @@ -1,18 +0,0 @@ -
- {{#commands}} - - - {{title}} - - {{/commands}} -
-
-
- - -
-
- - -
-
diff --git a/UI/Shared/Toolbar/ToolbarView.js b/UI/Shared/Toolbar/ToolbarView.js deleted file mode 100644 index 892ff3e94..000000000 --- a/UI/Shared/Toolbar/ToolbarView.js +++ /dev/null @@ -1,21 +0,0 @@ -"use strict"; -define(['app', 'Shared/Toolbar/CommandCollection'], function () { - - NzbDrone.Shared.Toolbar.ToolbarView = Backbone.Marionette.ItemView.extend({ - template: 'Shared/Toolbar/ToolbarTemplate', - - initialize: function () { - if (!this.collection) { - throw 'CommandCollection needs to be provided'; - } - - this.model = new Backbone.Model(); - this.model.set('commands', this.collection.toJSON()); - - } - }); -}); - - - -