Show Log In button at the bottom of the page body when login_required and not logged in

This commit is contained in:
Neil Lalonde 2013-10-25 16:05:59 -04:00
parent f4d9bf9181
commit ce2af5c6d1
3 changed files with 12 additions and 0 deletions

View File

@ -7,8 +7,15 @@
@module Discourse @module Discourse
**/ **/
Discourse.StaticController = Discourse.Controller.extend({ Discourse.StaticController = Discourse.Controller.extend({
needs: ['header'],
path: null,
showLoginButton: function() {
return this.get('path') === '/login';
}.property('path'),
loadPath: function(path) { loadPath: function(path) {
this.set('path', path);
var staticController = this; var staticController = this;
this.set('content', null); this.set('content', null);

View File

@ -2,6 +2,10 @@
<div class='contents clearfix body-page'> <div class='contents clearfix body-page'>
{{#if content}} {{#if content}}
{{{content}}} {{{content}}}
{{#if showLoginButton}}
<button class="btn btn-primary" {{action showLogin}}>{{i18n log_in}}</button>
{{/if}}
{{else}} {{else}}
<div class='spinner'>{{i18n loading}}</div> <div class='spinner'>{{i18n loading}}</div>
{{/if}} {{/if}}

View File

@ -14,6 +14,7 @@
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
font-size: 16px; font-size: 16px;
line-height: 22px; line-height: 22px;
margin: 20px 15px;
// Consistent vertical spacing // Consistent vertical spacing
blockquote, blockquote,