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() @computed()
allowImageUpload() { allowAvatarUpload() {
return Discourse.Utilities.allowsImages(); return this.siteSettings.allow_uploaded_avatars && Discourse.Utilities.allowsImages();
}, },
actions: { actions: {

View file

@ -5,12 +5,6 @@ import computed from "ember-addons/ember-computed-decorators";
export default Ember.Controller.extend(CanCheckEmails, { 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") @computed("model.watchedCategories", "model.trackedCategories", "model.mutedCategories")
selectedCategories(watched, tracked, muted) { selectedCategories(watched, tracked, muted) {
return [].concat(watched, tracked, muted); return [].concat(watched, tracked, muted);
@ -45,7 +39,7 @@ export default Ember.Controller.extend(CanCheckEmails, {
@computed() @computed()
nameInstructions() { 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") @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> <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"}} {{d-button action="refreshGravatar" title="user.change_avatar.refresh_gravatar_title" disabled=gravatarRefreshDisabled icon="refresh"}}
</div> </div>
{{#if allowImageUpload}} {{#if allowAvatarUpload}}
<div> <div>
<input type="radio" id="uploaded_avatar" name="avatar" value="uploaded" {{action "useUploadedAvatar"}}> <input type="radio" id="uploaded_avatar" name="avatar" value="uploaded" {{action "useUploadedAvatar"}}>
<label class="radio" for="uploaded_avatar"> <label class="radio" for="uploaded_avatar">

View file

@ -90,17 +90,13 @@
<div class="controls"> <div class="controls">
{{! we want the "huge" version even though we're downsizing it to "large" in CSS }} {{! we want the "huge" version even though we're downsizing it to "large" in CSS }}
{{bound-avatar model "huge"}} {{bound-avatar model "huge"}}
{{#if allowAvatarUpload}} {{#unless siteSettings.sso_overrides_avatar}}
{{d-button action="showAvatarSelector" class="pad-left" icon="pencil"}} {{d-button action="showAvatarSelector" class="pad-left" icon="pencil"}}
{{else}} {{/unless}}
{{#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}}
</div> </div>
</div> </div>
{{#if allowBackgrounds}} {{#if siteSettings.allow_profile_backgrounds}}
<div class="control-group pref-profile-bg"> <div class="control-group pref-profile-bg">
<label class="control-label">{{i18n 'user.change_profile_background.title'}}</label> <label class="control-label">{{i18n 'user.change_profile_background.title'}}</label>
<div class="controls"> <div class="controls">
@ -122,7 +118,7 @@
</div> </div>
{{/if}} {{/if}}
{{#if allowUserLocale}} {{#if siteSettings.allow_user_locale}}
<div class="control-group pref-locale"> <div class="control-group pref-locale">
<label class="control-label">{{i18n 'user.locale.title'}}</label> <label class="control-label">{{i18n 'user.locale.title'}}</label>
<div class="controls"> <div class="controls">
@ -213,7 +209,7 @@
{{preference-checkbox labelKey="user.enable_quoting" checked=model.enable_quoting}} {{preference-checkbox labelKey="user.enable_quoting" checked=model.enable_quoting}}
{{preference-checkbox labelKey="user.dynamic_favicon" checked=model.dynamic_favicon}} {{preference-checkbox labelKey="user.dynamic_favicon" checked=model.dynamic_favicon}}
{{preference-checkbox labelKey="user.disable_jump_reply" checked=model.disable_jump_reply}} {{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}} {{preference-checkbox labelKey="user.edit_history_public" checked=model.edit_history_public}}
{{/unless}} {{/unless}}