From b78d0188703b12f23d90d57032bdc40b9c8f5f2f Mon Sep 17 00:00:00 2001 From: rr- Date: Fri, 8 Apr 2016 20:09:32 +0200 Subject: [PATCH] client/login: don't show pw reset w/o working smtp --- client/build.js | 1 + client/html/login.hbs | 4 +++- client/js/views/login_view.js | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/client/build.js b/client/build.js index fa3fccfe..827b4c07 100644 --- a/client/build.js +++ b/client/build.js @@ -43,6 +43,7 @@ function getConfig() { console.warn('Local config does not exist, ignoring'); } + config.canSendMails = !!config.smtp.host; delete config.secret; delete config.smtp; delete config.database; diff --git a/client/html/login.hbs b/client/html/login.hbs index d6dd2629..36fcfad0 100644 --- a/client/html/login.hbs +++ b/client/html/login.hbs @@ -20,7 +20,9 @@
- Forgot the password? + {{#if this.canSendMails}} + Forgot the password? + {{/if}}
diff --git a/client/js/views/login_view.js b/client/js/views/login_view.js index f8b82a20..f0e90c09 100644 --- a/client/js/views/login_view.js +++ b/client/js/views/login_view.js @@ -12,7 +12,7 @@ class LoginView extends BaseView { render(ctx) { const target = this.contentHolder; - const source = this.template(); + const source = this.template({canSendMails: config.canSendMails}); const form = source.querySelector('form'); const userNameField = source.querySelector('#user-name');