From 9ea2d3010504c0246c3af2767ce1f2bb5c756322 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Tue, 27 Oct 2015 10:52:05 +0100 Subject: [PATCH] UX: always show the avatar modal now that we have the letter avatars --- .../discourse/controllers/avatar-selector.js.es6 | 4 ++-- .../discourse/controllers/preferences.js.es6 | 8 +------- .../discourse/templates/modal/avatar_selector.hbs | 2 +- .../discourse/templates/user/preferences.hbs | 14 +++++--------- 4 files changed, 9 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 b/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 index 32aa7b514..6a34f559b 100644 --- a/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 +++ b/app/assets/javascripts/discourse/controllers/avatar-selector.js.es6 @@ -21,8 +21,8 @@ export default Ember.Controller.extend(ModalFunctionality, { }, @computed() - allowImageUpload() { - return Discourse.Utilities.allowsImages(); + allowAvatarUpload() { + return this.siteSettings.allow_uploaded_avatars && Discourse.Utilities.allowsImages(); }, actions: { diff --git a/app/assets/javascripts/discourse/controllers/preferences.js.es6 b/app/assets/javascripts/discourse/controllers/preferences.js.es6 index a7aa333fb..f23f342e0 100644 --- a/app/assets/javascripts/discourse/controllers/preferences.js.es6 +++ b/app/assets/javascripts/discourse/controllers/preferences.js.es6 @@ -5,12 +5,6 @@ import computed from "ember-addons/ember-computed-decorators"; export default Ember.Controller.extend(CanCheckEmails, { - allowAvatarUpload: setting('allow_uploaded_avatars'), - allowUserLocale: setting('allow_user_locale'), - ssoOverridesAvatar: setting('sso_overrides_avatar'), - allowBackgrounds: setting('allow_profile_backgrounds'), - editHistoryVisible: setting('edit_history_visible_to_public'), - @computed("model.watchedCategories", "model.trackedCategories", "model.mutedCategories") selectedCategories(watched, tracked, muted) { return [].concat(watched, tracked, muted); @@ -45,7 +39,7 @@ export default Ember.Controller.extend(CanCheckEmails, { @computed() nameInstructions() { - return I18n.t(Discourse.SiteSettings.full_name_required ? 'user.name.instructions_required' : 'user.name.instructions'); + return I18n.t(this.siteSettings.full_name_required ? 'user.name.instructions_required' : 'user.name.instructions'); }, @computed("model.has_title_badges") diff --git a/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs b/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs index e7d070d81..760ab1a58 100644 --- a/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs +++ b/app/assets/javascripts/discourse/templates/modal/avatar_selector.hbs @@ -9,7 +9,7 @@ {{d-button action="refreshGravatar" title="user.change_avatar.refresh_gravatar_title" disabled=gravatarRefreshDisabled icon="refresh"}} - {{#if allowImageUpload}} + {{#if allowAvatarUpload}}
- {{#if allowBackgrounds}} + {{#if siteSettings.allow_profile_backgrounds}}
@@ -122,7 +118,7 @@
{{/if}} - {{#if allowUserLocale}} + {{#if siteSettings.allow_user_locale}}
@@ -213,7 +209,7 @@ {{preference-checkbox labelKey="user.enable_quoting" checked=model.enable_quoting}} {{preference-checkbox labelKey="user.dynamic_favicon" checked=model.dynamic_favicon}} {{preference-checkbox labelKey="user.disable_jump_reply" checked=model.disable_jump_reply}} - {{#unless editHistoryVisible}} + {{#unless siteSettings.edit_history_visible_to_public}} {{preference-checkbox labelKey="user.edit_history_public" checked=model.edit_history_public}} {{/unless}}