From f94220c5ffb4f6e2a314bed22cbb935219805ccf Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Fri, 14 Jun 2013 21:02:40 -0700 Subject: [PATCH] Version added to footer --- UI/Content/base.less | 10 ---------- UI/Content/theme.less | 12 +++++++++++- UI/Controller.js | 3 ++- UI/Index.html | 2 +- UI/Routing.js | 1 + UI/Shared/Footer/Model.js | 11 +++++++++++ UI/Shared/Footer/Template.html | 2 ++ UI/Shared/Footer/View.js | 15 +++++++++++++++ UI/Shared/Footer/footer.less | 3 +++ UI/app.js | 11 ++++++----- 10 files changed, 52 insertions(+), 18 deletions(-) create mode 100644 UI/Shared/Footer/Model.js create mode 100644 UI/Shared/Footer/Template.html create mode 100644 UI/Shared/Footer/View.js create mode 100644 UI/Shared/Footer/footer.less diff --git a/UI/Content/base.less b/UI/Content/base.less index 162cbb588..dabbfe31b 100644 --- a/UI/Content/base.less +++ b/UI/Content/base.less @@ -56,16 +56,6 @@ html { font-size: 13px; } -#footer-region { - font-size: 16px; - text-decoration: none; - font-weight: lighter; - margin: 20px 0 30px 0; - a:hover { - text-decoration: underline; - } -} - #notification-region { pre { font-size: 12px; diff --git a/UI/Content/theme.less b/UI/Content/theme.less index 9193efa49..53218330e 100644 --- a/UI/Content/theme.less +++ b/UI/Content/theme.less @@ -447,11 +447,21 @@ ul.stat-list li label, ul.stat-list li h4, ul.stat-list li small, ul.stat-list l } footer { - padding-top: 20px; + font-size: 13px; + font-weight: lighter; + padding-top: 0px; padding-bottom: 20px; color: #999999; + margin: 0; + text-decoration: none; + a { color: #999999; + text-decoration: underline; + } + + p { + margin-bottom: 0px; } } diff --git a/UI/Controller.js b/UI/Controller.js index 6d99ccb3a..55343abd1 100644 --- a/UI/Controller.js +++ b/UI/Controller.js @@ -15,7 +15,8 @@ define(['app', 'Missing/MissingLayout', 'History/HistoryLayout', 'Shared/FormatHelpers', - 'Shared/TemplateHelpers'], + 'Shared/TemplateHelpers', + 'Shared/Footer/View'], function () { var controller = Backbone.Marionette.Controller.extend({ diff --git a/UI/Index.html b/UI/Index.html index 82bde03fd..73fc8e89e 100644 --- a/UI/Index.html +++ b/UI/Index.html @@ -69,7 +69,7 @@
-

© Copyright 2013 NzbDrone

+
diff --git a/UI/Routing.js b/UI/Routing.js index f45ea2bbe..ad82e03ff 100644 --- a/UI/Routing.js +++ b/UI/Routing.js @@ -28,6 +28,7 @@ require(['app', 'Controller', 'RouteBinder'], function (app, controller, routeBi Backbone.history.start({ pushState: true }); routeBinder.bind(); + NzbDrone.footerRegion.show(new NzbDrone.Shared.Footer.View()); }); }); diff --git a/UI/Shared/Footer/Model.js b/UI/Shared/Footer/Model.js new file mode 100644 index 000000000..3e6261bd1 --- /dev/null +++ b/UI/Shared/Footer/Model.js @@ -0,0 +1,11 @@ +"use strict"; +define(['app'], function () { + + NzbDrone.Shared.Footer.Model = Backbone.Model.extend({ + defaults: { + 'version' : '0.0.0.0' + } + }); + + return NzbDrone.Shared.Footer.Model; +}); diff --git a/UI/Shared/Footer/Template.html b/UI/Shared/Footer/Template.html new file mode 100644 index 000000000..21d3de7ed --- /dev/null +++ b/UI/Shared/Footer/Template.html @@ -0,0 +1,2 @@ +

© Copyright 2013 NzbDrone

+

v{{version}}

\ No newline at end of file diff --git a/UI/Shared/Footer/View.js b/UI/Shared/Footer/View.js new file mode 100644 index 000000000..03512522c --- /dev/null +++ b/UI/Shared/Footer/View.js @@ -0,0 +1,15 @@ +"use strict"; +define(['app', + 'Shared/Footer/Model'], function () { + NzbDrone.Shared.Footer.View = Backbone.Marionette.ItemView.extend({ + + template: 'Shared/Footer/Template', + + initialize: function () { + this.model = new NzbDrone.Shared.Footer.Model(); + this.model.version = NzbDrone.Constants.Version; + } + }); + + return new NzbDrone.Shared.Footer.View(); +}); diff --git a/UI/Shared/Footer/footer.less b/UI/Shared/Footer/footer.less new file mode 100644 index 000000000..5f989373d --- /dev/null +++ b/UI/Shared/Footer/footer.less @@ -0,0 +1,3 @@ +footer { + font-size: 12.6px; +} \ No newline at end of file diff --git a/UI/app.js b/UI/app.js index 6920b406a..8bfac1f33 100644 --- a/UI/app.js +++ b/UI/app.js @@ -127,7 +127,6 @@ define([ Activity: {} }; - window.NzbDrone.Quality = {}; window.NzbDrone.Commands = {}; @@ -136,8 +135,8 @@ define([ Toolbar : {}, Messenger : {}, FormatHelpers: {}, - Grid : {} - + Grid : {}, + Footer : {} }; window.NzbDrone.Cells = {}; @@ -172,7 +171,8 @@ define([ }; window.NzbDrone.Constants = { - ApiRoot: '/api' + ApiRoot: '/api', + Version: '0.0.0.0' }; window.NzbDrone.addInitializer(function () { @@ -184,7 +184,8 @@ define([ NzbDrone.addRegions({ mainRegion : '#main-region', notificationRegion: '#notification-region', - modalRegion : ModalRegion + modalRegion : ModalRegion, + footerRegion : '#footer-region' }); window.NzbDrone.start();