FIX: also show Sign Up button on front page of private sites that allow new registrations

This commit is contained in:
Neil Lalonde 2016-02-03 11:36:28 -05:00
parent 3f67f91d27
commit 2ff4248c19
2 changed files with 15 additions and 1 deletions

View File

@ -1,6 +1,16 @@
import computed from 'ember-addons/ember-computed-decorators';
export default Ember.Controller.extend({ export default Ember.Controller.extend({
needs: ['application'],
showLoginButton: Em.computed.equal("model.path", "login"), showLoginButton: Em.computed.equal("model.path", "login"),
@computed("model.path")
showSignupButton() {
return this.get("model.path") === "login" && this.get('controllers.application.canSignUp');
},
actions: { actions: {
markFaqRead() { markFaqRead() {
const currentUser = this.currentUser; const currentUser = this.currentUser;

View File

@ -3,8 +3,12 @@
{{plugin-outlet "above-static"}} {{plugin-outlet "above-static"}}
{{{model.html}}} {{{model.html}}}
{{#if showSignupButton}}
{{d-button action="showCreateAccount" class="btn-primary sign-up-button" label="sign_up"}}
{{/if}}
{{#if showLoginButton}} {{#if showLoginButton}}
<button class="btn btn-primary" {{action "showLogin"}}>{{fa-icon "user"}}{{i18n 'log_in'}}</button> {{d-button action="showLogin" class="btn-primary login-button" icon="user" label="log_in"}}
{{/if}} {{/if}}
</div> </div>
</div> </div>