From 20d2908c505c506c96e5621d89f341ea163515ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= <regis@hanol.fr> Date: Thu, 15 Jan 2015 19:32:19 +0100 Subject: [PATCH] FEATURE: add a global notice whenever emails are disabled (disable_emails site setting) --- .../javascripts/discourse/components/global-notice.js.es6 | 4 ++++ config/locales/client.en.yml | 2 ++ config/site_settings.yml | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/components/global-notice.js.es6 b/app/assets/javascripts/discourse/components/global-notice.js.es6 index 0f6f60f67..bde5b4aaa 100644 --- a/app/assets/javascripts/discourse/components/global-notice.js.es6 +++ b/app/assets/javascripts/discourse/components/global-notice.js.es6 @@ -10,6 +10,10 @@ export default Ember.Component.extend(StringBuffer, { notices.push(I18n.t("read_only_mode.enabled")); } + if (this.siteSettings.disable_emails) { + notices.push(I18n.t("emails_are_disabled")); + } + if (Discourse.User.currentProp('admin') && this.siteSettings.show_create_topics_notice) { var topic_count = 0, post_count = 0; diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index c060b77f0..f4284d28a 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -103,6 +103,8 @@ en: topic_admin_menu: "topic admin actions" + emails_are_disabled: "Administrators have disabled emails." + edit: 'edit the title and category of this topic' not_implemented: "That feature hasn't been implemented yet, sorry!" no_value: "No" diff --git a/config/site_settings.yml b/config/site_settings.yml index 343d77f5d..8e4709a43 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -428,7 +428,9 @@ email: enum: 'TrustLevelSetting' email_prefix: '' email_site_title: '' - disable_emails: false + disable_emails: + default: false + client: true strip_images_from_short_emails: true short_email_length: 2800