mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:52:46 +08:00
Merge pull request #1366 from ZogStriP/do-not-disable-the-radio-button
do not disable the radio button in the avatar selection modal
This commit is contained in:
commit
3760cba549
|
@ -1,10 +1,12 @@
|
||||||
<div class="modal-body">
|
<div class="modal-body">
|
||||||
<div>
|
<div>
|
||||||
<input type="radio" id="avatar" name="avatar" value="gravatar" {{action toggleUseUploadedAvatar false}}>
|
|
||||||
<label class="radio" for="avatar">{{avatar controller imageSize="large" template="gravatar_template"}} {{{i18n user.change_avatar.gravatar}}} {{currentUser.email}}</label>
|
|
||||||
<a href="//gravatar.com/emails" target="_blank" title="{{i18n user.change_avatar.gravatar_title}}" class="btn"><i class="icon-pencil"></i></a>
|
|
||||||
<div>
|
<div>
|
||||||
<input type="radio" id="uploaded_avatar" name="avatar" value="uploaded_avatar" {{action toggleUseUploadedAvatar true}} {{bindAttr disabled="view.uploadedAvatarDisabled" }}>
|
<input type="radio" id="avatar" name="avatar" value="gravatar" {{action toggleUseUploadedAvatar false}}>
|
||||||
|
<label class="radio" for="avatar">{{avatar controller imageSize="large" template="gravatar_template"}} {{{i18n user.change_avatar.gravatar}}} {{currentUser.email}}</label>
|
||||||
|
<a href="//gravatar.com/emails" target="_blank" title="{{i18n user.change_avatar.gravatar_title}}" class="btn"><i class="icon-pencil"></i></a>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<input type="radio" id="uploaded_avatar" name="avatar" value="uploaded_avatar" {{action toggleUseUploadedAvatar true}}>
|
||||||
<label class="radio" for="uploaded_avatar">
|
<label class="radio" for="uploaded_avatar">
|
||||||
{{#if has_uploaded_avatar}}
|
{{#if has_uploaded_avatar}}
|
||||||
{{boundAvatar controller imageSize="large" template="uploaded_avatar_template"}} {{i18n user.change_avatar.uploaded_avatar}}
|
{{boundAvatar controller imageSize="large" template="uploaded_avatar_template"}} {{i18n user.change_avatar.uploaded_avatar}}
|
||||||
|
@ -24,6 +26,6 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="modal-footer">
|
<div class="modal-footer">
|
||||||
<button class="btn btn-primary" {{action saveAvatarSelection}} data-dismiss="modal">{{i18n save}}</button>
|
<button class="btn btn-primary" {{action saveAvatarSelection}} data-dismiss="modal" {{bindAttr disabled="view.saveDisabled"}}>{{i18n save}}</button>
|
||||||
<a data-dismiss="modal">{{i18n cancel}}</a>
|
<a data-dismiss="modal">{{i18n cancel}}</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -12,7 +12,9 @@ Discourse.AvatarSelectorView = Discourse.ModalBodyView.extend({
|
||||||
title: I18n.t('user.change_avatar.title'),
|
title: I18n.t('user.change_avatar.title'),
|
||||||
uploading: false,
|
uploading: false,
|
||||||
uploadProgress: 0,
|
uploadProgress: 0,
|
||||||
uploadedAvatarDisabled: Em.computed.not("controller.has_uploaded_avatar"),
|
useGravatar: Em.computed.not("controller.use_uploaded_avatar"),
|
||||||
|
canSaveAvatarSelection: Em.computed.or("useGravatar", "controller.has_uploaded_avatar"),
|
||||||
|
saveDisabled: Em.computed.not("canSaveAvatarSelection"),
|
||||||
|
|
||||||
didInsertElement: function() {
|
didInsertElement: function() {
|
||||||
var view = this;
|
var view = this;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user