From 58385248a6a4d3d0170c0a12810af9c9dcf412f9 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Tue, 6 Jan 2015 17:28:42 -0500 Subject: [PATCH] Show contact_email on about page --- .../javascripts/discourse/controllers/about.js.es6 | 11 +++++++++++ app/assets/javascripts/discourse/templates/about.hbs | 12 ++++++------ config/site_settings.yml | 1 + 3 files changed, 18 insertions(+), 6 deletions(-) create mode 100644 app/assets/javascripts/discourse/controllers/about.js.es6 diff --git a/app/assets/javascripts/discourse/controllers/about.js.es6 b/app/assets/javascripts/discourse/controllers/about.js.es6 new file mode 100644 index 00000000000..f88b331cae6 --- /dev/null +++ b/app/assets/javascripts/discourse/controllers/about.js.es6 @@ -0,0 +1,11 @@ +import ObjectController from 'discourse/controllers/object'; + +export default ObjectController.extend({ + contactInfo: function() { + if (Discourse.SiteSettings.contact_email) { + return I18n.t('about.contact_info', {contact_email: Discourse.SiteSettings.contact_email}); + } else { + return null; + } + }.property() +}); diff --git a/app/assets/javascripts/discourse/templates/about.hbs b/app/assets/javascripts/discourse/templates/about.hbs index ba62d0548fc..183269be585 100644 --- a/app/assets/javascripts/discourse/templates/about.hbs +++ b/app/assets/javascripts/discourse/templates/about.hbs @@ -61,11 +61,11 @@ -
-

{{i18n 'about.contact'}}

-

- {{i18n 'about.contact_info' contact_email='name@example.com'}} -

-
+ {{#if contactInfo}} +
+

{{i18n 'about.contact'}}

+

{{contactInfo}}

+
+ {{/if}} diff --git a/config/site_settings.yml b/config/site_settings.yml index 9af1cdf4034..db6ab02c432 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -21,6 +21,7 @@ required: site_description: default: '' contact_email: + client: true default: '' type: email notification_email: