removed title region,

started adding support for a global tool bar.
pull/23/head
Keivan Beigi 12 years ago
parent a8e76b3251
commit 3638d85314

@ -27,6 +27,7 @@
<option name="m_maxLength" value="32" /> <option name="m_maxLength" value="32" />
</inspection_tool> </inspection_tool>
<inspection_tool class="HtmlFormInputWithoutLabel" enabled="false" level="WEAK WARNING" enabled_by_default="false" /> <inspection_tool class="HtmlFormInputWithoutLabel" enabled="false" level="WEAK WARNING" enabled_by_default="false" />
<inspection_tool class="HtmlPresentationalElement" enabled="true" level="WEAK WARNING" enabled_by_default="true" />
<inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true"> <inspection_tool class="HtmlUnknownAttribute" enabled="true" level="WARNING" enabled_by_default="true">
<option name="myValues"> <option name="myValues">
<value> <value>

@ -72,7 +72,7 @@ define(['app', 'Shared/ModalRegion', 'AddSeries/AddSeriesLayout',
}, },
_setTitle: function (title) { _setTitle: function (title) {
$('#title-region').html(title); //$('#title-region').html(title);
if (title.toLocaleLowerCase() === 'nzbdrone') { if (title.toLocaleLowerCase() === 'nzbdrone') {
window.document.title = 'NzbDrone'; window.document.title = 'NzbDrone';

@ -69,9 +69,6 @@
<div class="page-container"> <div class="page-container">
<div class="container"> <div class="container">
<div class="row"> <div class="row">
<div class="span12 header">
<h4 id="title-region">NZBDRONE</h4>
</div>
<div class="span12" id="notification-region"/> <div class="span12" id="notification-region"/>
</div> </div>
<div class="span12" id="main-region"></div> <div class="span12" id="main-region"></div>

@ -2,18 +2,22 @@
define([ define([
'app', 'app',
'Series/Index/List/CollectionView', 'Series/Index/List/CollectionView',
'Config'
'Series/Index/Posters/CollectionView', 'Series/Index/Posters/CollectionView',
'Series/Index/EmptyView', 'Series/Index/EmptyView',
'Config', 'Config',
'Series/Index/Table/AirDateCell', 'Series/Index/Table/AirDateCell',
'Series/Index/Table/SeriesStatusCell' 'Series/Index/Table/SeriesStatusCell'
'Shared/Toolbar/ToolbarView',
'Config'
], ],
function () { function () {
NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({ NzbDrone.Series.Index.SeriesIndexLayout = Backbone.Marionette.Layout.extend({
template: 'Series/Index/SeriesIndexLayoutTemplate', template: 'Series/Index/SeriesIndexLayoutTemplate',
regions: { regions: {
series: '#x-series' series : '#x-series',
toolbar: '#x-toolbar'
}, },
ui: { ui: {
@ -175,6 +179,15 @@ define([
}, },
onShow: function () { 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) { switch (this.viewStyle) {
case 1: case 1:
this.showList(); this.showList();

@ -1,6 +1,12 @@
<div class="row"> <!--<div class="row series-toolbar">
<div class="span10"></div> <div class="span12">
<div class="span2"> <div class="pull-left">
<div class="btn-group">
<button class="btn">Left</button>
<button class="btn">Middle</button>
<button class="btn">Right</button>
</div>
</div>
<div class="pull-right"> <div class="pull-right">
<div class="btn-toolbar"> <div class="btn-toolbar">
<div class="btn-group"> <div class="btn-group">
@ -11,9 +17,10 @@
</div> </div>
</div> </div>
</div> </div>
</div> </div>-->
<div id="x-toolbar"></div>
<div class="row"> <div class="row">
<div class="span12"> <div class="span12">
<div id="x-series"></div> <div id="x-series"></div>
</div> </div>
</div> </div>

@ -0,0 +1,7 @@
"use strict";
define(['app', 'Shared/Toolbar/CommandModel'], function () {
NzbDrone.Shared.Toolbar.CommandCollection = Backbone.Collection.extend({
model: NzbDrone.Shared.Toolbar.CommandModel
});
});

@ -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
}
});
});

@ -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
}
});
});

@ -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
}
});
});

@ -0,0 +1,18 @@
 <div class="btn-group">
{{#commands}}
<a class="btn" href="{{target}}" data-target="0">
<i class="{{icon}}"/>
{{title}}
</a>
{{/commands}}
</div>
<div class="pull-right">
<div class="btn-group">
<a class="btn x-series-change-view x-series-show-table" href="#" title="Table" data-target="0"><i class="icon-table"></i></a>
<a class="btn x-series-change-view x-series-show-list" href="#" title="List" data-target="1"><i class="icon-list"></i></a>
</div>
</div>
<!--replace this with padding-->
<br/>
<br/>

@ -1,14 +1,18 @@
"use strict"; "use strict";
define(['app'], function () { define(['app', 'Shared/Toolbar/CommandCollection'], function () {
NzbDrone.Shared.Toolbar.ToolbarView = Backbone.Marionette.ItemView.extend({ 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());
}
}); });
}); });

@ -76,7 +76,6 @@ define('app', function () {
}); });
NzbDrone.addRegions({ NzbDrone.addRegions({
titleRegion : '#title-region',
mainRegion : '#main-region', mainRegion : '#main-region',
notificationRegion: '#notification-region' notificationRegion: '#notification-region'
}); });

Loading…
Cancel
Save