diff --git a/UI/Series/Index/SeriesIndexLayout.js b/UI/Series/Index/SeriesIndexLayout.js
index 6f6e8a9de..486ca545e 100644
--- a/UI/Series/Index/SeriesIndexLayout.js
+++ b/UI/Series/Index/SeriesIndexLayout.js
@@ -2,18 +2,22 @@
define([
'app',
'Series/Index/List/CollectionView',
+ 'Config'
'Series/Index/Posters/CollectionView',
'Series/Index/EmptyView',
'Config',
'Series/Index/Table/AirDateCell',
'Series/Index/Table/SeriesStatusCell'
+ 'Shared/Toolbar/ToolbarView',
+ 'Config'
],
function () {
NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({
template: 'Series/Index/SeriesIndexLayoutTemplate',
regions: {
- series: '#x-series'
+ series : '#x-series',
+ toolbar: '#x-toolbar'
},
ui: {
@@ -175,6 +179,15 @@ define([
},
onShow: function () {
+
+ var commands = 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"}));
+
+ this.toolbar.show(new NzbDrone.Shared.Toolbar.ToolbarView({collection: commands}));
+
switch (this.viewStyle) {
case 1:
this.showList();
diff --git a/UI/Series/Index/SeriesIndexLayoutTemplate.html b/UI/Series/Index/SeriesIndexLayoutTemplate.html
index 4fb81b4ed..1911ff456 100644
--- a/UI/Series/Index/SeriesIndexLayoutTemplate.html
+++ b/UI/Series/Index/SeriesIndexLayoutTemplate.html
@@ -1,6 +1,12 @@
-
-
-
+
+
\ No newline at end of file
+
diff --git a/UI/Shared/Toolbar/CommandCollection.js b/UI/Shared/Toolbar/CommandCollection.js
new file mode 100644
index 000000000..be18e4d37
--- /dev/null
+++ b/UI/Shared/Toolbar/CommandCollection.js
@@ -0,0 +1,7 @@
+"use strict";
+define(['app', 'Shared/Toolbar/CommandModel'], function () {
+ NzbDrone.Shared.Toolbar.CommandCollection = Backbone.Collection.extend({
+ model: NzbDrone.Shared.Toolbar.CommandModel
+ });
+});
+
diff --git a/UI/Shared/Toolbar/CommandModel.js b/UI/Shared/Toolbar/CommandModel.js
new file mode 100644
index 000000000..726e6e769
--- /dev/null
+++ b/UI/Shared/Toolbar/CommandModel.js
@@ -0,0 +1,17 @@
+"use strict";
+define(['app'], function () {
+
+ NzbDrone.Shared.Toolbar.CommandTypes =
+ {
+ RouteTrigger: 'RouteTrigger'
+ };
+
+ NzbDrone.Shared.Toolbar.CommandModel = Backbone.Model.extend({
+ defaults: {
+ 'target' : '/nzbdrone/route',
+ 'title' : 'Title Goes Here',
+ 'alignment': 'left',
+ 'tooltip' : undefined
+ }
+ });
+});
diff --git a/UI/Shared/Toolbar/ToolbarCollection.js b/UI/Shared/Toolbar/ToolbarCollection.js
deleted file mode 100644
index f2e12c59f..000000000
--- a/UI/Shared/Toolbar/ToolbarCollection.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-define(['app'], function () {
-
- NzbDrone.Shared.Toolbar.ToolbarModel = Backbone.Model.extend({
-
- defaults: {
- "route" : '/nzbdrone/route',
- "title" : 'Title Goes Here',
- "tooltip": undefined
- }
- });
-});
\ No newline at end of file
diff --git a/UI/Shared/Toolbar/ToolbarModel.js b/UI/Shared/Toolbar/ToolbarModel.js
deleted file mode 100644
index f2e12c59f..000000000
--- a/UI/Shared/Toolbar/ToolbarModel.js
+++ /dev/null
@@ -1,12 +0,0 @@
-"use strict";
-define(['app'], function () {
-
- NzbDrone.Shared.Toolbar.ToolbarModel = Backbone.Model.extend({
-
- defaults: {
- "route" : '/nzbdrone/route',
- "title" : 'Title Goes Here',
- "tooltip": undefined
- }
- });
-});
\ No newline at end of file
diff --git a/UI/Shared/Toolbar/ToolbarTemplate.html b/UI/Shared/Toolbar/ToolbarTemplate.html
new file mode 100644
index 000000000..856f5d4b5
--- /dev/null
+++ b/UI/Shared/Toolbar/ToolbarTemplate.html
@@ -0,0 +1,18 @@
+
+
+
+
+
+
diff --git a/UI/Shared/Toolbar/ToolbarView.js b/UI/Shared/Toolbar/ToolbarView.js
index 4b198dbd7..892ff3e94 100644
--- a/UI/Shared/Toolbar/ToolbarView.js
+++ b/UI/Shared/Toolbar/ToolbarView.js
@@ -1,14 +1,18 @@
"use strict";
-define(['app'], function () {
+define(['app', 'Shared/Toolbar/CommandCollection'], function () {
NzbDrone.Shared.Toolbar.ToolbarView = Backbone.Marionette.ItemView.extend({
- template: 'Template',
+ template: 'Shared/Toolbar/ToolbarTemplate',
- events: {
+ initialize: function () {
+ if (!this.collection) {
+ throw 'CommandCollection needs to be provided';
+ }
+
+ this.model = new Backbone.Model();
+ this.model.set('commands', this.collection.toJSON());
}
-
-
});
});
diff --git a/UI/app.js b/UI/app.js
index b491f41aa..263416f5a 100644
--- a/UI/app.js
+++ b/UI/app.js
@@ -76,7 +76,6 @@ define('app', function () {
});
NzbDrone.addRegions({
- titleRegion : '#title-region',
mainRegion : '#main-region',
notificationRegion: '#notification-region'
});