Don't show the upload avatar modal is allow_uploaded_avatars is false.

This commit is contained in:
Vikhyat Korrapati 2013-12-06 11:31:11 +05:30
parent 2850279c45
commit 483c9f9826
2 changed files with 9 additions and 1 deletions

View File

@ -7,6 +7,10 @@
@module Discourse
**/
Discourse.PreferencesController = Discourse.ObjectController.extend({
allowAvatarUpload: function() {
return Discourse.SiteSetting.allow_uploaded_avatars;
}.property(),
// By default we haven't saved anything
saved: false,

View File

@ -49,7 +49,11 @@
<label class="control-label">{{i18n user.avatar.title}}</label>
<div class="controls">
{{boundAvatar model imageSize="large"}}
<button {{action showAvatarSelector}} class="btn pad-left"><i class="icon-pencil"></i></button>
{{#if allowAvatarUpload}}
<button {{action showAvatarSelector}} class="btn pad-left"><i class="icon-pencil"></i></button>
{{else}}
<a href="//gravatar.com/emails" target="_blank" title="{{i18n user.change_avatar.gravatar_title}}" class="btn"><i class="icon-pencil"></i></a>
{{/if}}
</div>
</div>