UX: always show the avatar modal now that we have the letter avatars

This commit is contained in:
Régis Hanol 2015-10-27 10:52:05 +01:00
parent 5dab5ada1c
commit 9ea2d30105
4 changed files with 9 additions and 19 deletions

View file

@ -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: {

View file

@ -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")

View file

@ -9,7 +9,7 @@
<label class="radio" for="gravatar">{{bound-avatar-template gravatar_avatar_template "large"}} {{{i18n 'user.change_avatar.gravatar'}}} {{email}}</label>
{{d-button action="refreshGravatar" title="user.change_avatar.refresh_gravatar_title" disabled=gravatarRefreshDisabled icon="refresh"}}
</div>
{{#if allowImageUpload}}
{{#if allowAvatarUpload}}
<div>
<input type="radio" id="uploaded_avatar" name="avatar" value="uploaded" {{action "useUploadedAvatar"}}>
<label class="radio" for="uploaded_avatar">

View file

@ -90,17 +90,13 @@
<div class="controls">
{{! we want the "huge" version even though we're downsizing it to "large" in CSS }}
{{bound-avatar model "huge"}}
{{#if allowAvatarUpload}}
{{#unless siteSettings.sso_overrides_avatar}}
{{d-button action="showAvatarSelector" class="pad-left" icon="pencil"}}
{{else}}
{{#unless ssoOverridesAvatar}}
<a href="//gravatar.com/emails" target="_blank" title="{{i18n 'user.change_avatar.gravatar_title'}}" class="btn no-text">{{fa-icon "pencil"}}</a>
{{/unless}}
{{/if}}
{{/unless}}
</div>
</div>
{{#if allowBackgrounds}}
{{#if siteSettings.allow_profile_backgrounds}}
<div class="control-group pref-profile-bg">
<label class="control-label">{{i18n 'user.change_profile_background.title'}}</label>
<div class="controls">
@ -122,7 +118,7 @@
</div>
{{/if}}
{{#if allowUserLocale}}
{{#if siteSettings.allow_user_locale}}
<div class="control-group pref-locale">
<label class="control-label">{{i18n 'user.locale.title'}}</label>
<div class="controls">
@ -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}}