From dabdcf59c478ac27f84a7718ac8d66e13649b3c8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Mon, 18 Nov 2013 17:13:24 +0100 Subject: [PATCH] allow for arbitrary HTML at the top/bottom of every pages --- .../discourse/components/logo_component.js | 1 + .../discourse/controllers/static_controller.js | 14 ++++++++------ .../discourse/templates/list.js.handlebars | 4 +++- .../discourse/templates/topic.js.handlebars | 3 +++ .../javascripts/discourse/views/html_view.js | 15 +++++++++++++++ app/models/site_content.rb | 2 ++ app/views/layouts/application.html.erb | 6 ++++++ config/locales/server.en.yml | 6 ++++++ 8 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 app/assets/javascripts/discourse/views/html_view.js diff --git a/app/assets/javascripts/discourse/components/logo_component.js b/app/assets/javascripts/discourse/components/logo_component.js index 3091ff09603..443d666a2fa 100644 --- a/app/assets/javascripts/discourse/components/logo_component.js +++ b/app/assets/javascripts/discourse/components/logo_component.js @@ -1,4 +1,5 @@ Discourse.DiscourseLogoComponent = Ember.Component.extend({ + linkUrl: function() { return Discourse.getURL("/"); }.property(), diff --git a/app/assets/javascripts/discourse/controllers/static_controller.js b/app/assets/javascripts/discourse/controllers/static_controller.js index e02d6fee20a..f3f945b8306 100644 --- a/app/assets/javascripts/discourse/controllers/static_controller.js +++ b/app/assets/javascripts/discourse/controllers/static_controller.js @@ -15,20 +15,22 @@ Discourse.StaticController = Discourse.Controller.extend({ }.property('path'), loadPath: function(path) { - this.set('path', path); - var staticController = this; - this.set('content', null); + var self = this; + + this.setProperties({ + path: path, + content: null + }); // Load from diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 4225b622c4b..8e8090b74f4 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -476,6 +476,12 @@ en: login_required: title: "Login Required: Homepage" description: "The text displayed for unauthorized users when login is required on the site." + top: + title: "Top of the pages" + description: "HTML that will be added at the top of every pages (after the header, before the navigation or the topic title)" + bottom: + title: "Bottom of the pages" + description: "HTML that will be added at the bottom of every pages" site_settings: default_locale: "The default language of this Discourse instance (ISO 639-1 Code)"