From ce2af5c6d18d4f1662eb1c30012bbff95144b83c Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Fri, 25 Oct 2013 16:05:59 -0400 Subject: [PATCH] Show Log In button at the bottom of the page body when login_required and not logged in --- .../javascripts/discourse/controllers/static_controller.js | 7 +++++++ .../javascripts/discourse/templates/static.js.handlebars | 4 ++++ app/assets/stylesheets/mobile/faqs.scss | 1 + 3 files changed, 12 insertions(+) diff --git a/app/assets/javascripts/discourse/controllers/static_controller.js b/app/assets/javascripts/discourse/controllers/static_controller.js index 9cf97a139..e02d6fee2 100644 --- a/app/assets/javascripts/discourse/controllers/static_controller.js +++ b/app/assets/javascripts/discourse/controllers/static_controller.js @@ -7,8 +7,15 @@ @module Discourse **/ Discourse.StaticController = Discourse.Controller.extend({ + needs: ['header'], + path: null, + + showLoginButton: function() { + return this.get('path') === '/login'; + }.property('path'), loadPath: function(path) { + this.set('path', path); var staticController = this; this.set('content', null); diff --git a/app/assets/javascripts/discourse/templates/static.js.handlebars b/app/assets/javascripts/discourse/templates/static.js.handlebars index 5e3225513..37f0750b6 100644 --- a/app/assets/javascripts/discourse/templates/static.js.handlebars +++ b/app/assets/javascripts/discourse/templates/static.js.handlebars @@ -2,6 +2,10 @@
{{#if content}} {{{content}}} + + {{#if showLoginButton}} + + {{/if}} {{else}}
{{i18n loading}}
{{/if}} diff --git a/app/assets/stylesheets/mobile/faqs.scss b/app/assets/stylesheets/mobile/faqs.scss index 2d0341123..87b508a68 100644 --- a/app/assets/stylesheets/mobile/faqs.scss +++ b/app/assets/stylesheets/mobile/faqs.scss @@ -14,6 +14,7 @@ font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 22px; + margin: 20px 15px; // Consistent vertical spacing blockquote,