mirror of https://github.com/lidarr/Lidarr
removed title region,
started adding support for a global tool bar.
This commit is contained in:
parent
a8e76b3251
commit
3638d85314
|
@ -27,6 +27,7 @@
|
|||
<option name="m_maxLength" value="32" />
|
||||
</inspection_tool>
|
||||
<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">
|
||||
<option name="myValues">
|
||||
<value>
|
||||
|
|
|
@ -72,7 +72,7 @@ define(['app', 'Shared/ModalRegion', 'AddSeries/AddSeriesLayout',
|
|||
},
|
||||
|
||||
_setTitle: function (title) {
|
||||
$('#title-region').html(title);
|
||||
//$('#title-region').html(title);
|
||||
|
||||
if (title.toLocaleLowerCase() === 'nzbdrone') {
|
||||
window.document.title = 'NzbDrone';
|
||||
|
|
|
@ -69,9 +69,6 @@
|
|||
<div class="page-container">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="span12 header">
|
||||
<h4 id="title-region">NZBDRONE</h4>
|
||||
</div>
|
||||
<div class="span12" id="notification-region"/>
|
||||
</div>
|
||||
<div class="span12" id="main-region"></div>
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -1,6 +1,12 @@
|
|||
<div class="row">
|
||||
<div class="span10"></div>
|
||||
<div class="span2">
|
||||
<!--<div class="row series-toolbar">
|
||||
<div class="span12">
|
||||
<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="btn-toolbar">
|
||||
<div class="btn-group">
|
||||
|
@ -11,7 +17,8 @@
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>-->
|
||||
<div id="x-toolbar"></div>
|
||||
<div class="row">
|
||||
<div class="span12">
|
||||
<div id="x-series"></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";
|
||||
define(['app'], function () {
|
||||
define(['app', 'Shared/Toolbar/CommandCollection'], function () {
|
||||
|
||||
NzbDrone.Shared.Toolbar.ToolbarView = Backbone.Marionette.ItemView.extend({
|
||||
template: 'Template',
|
||||
|
||||
events: {
|
||||
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());
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in New Issue