UX: change glyph when inviting existing user to a topic

This commit is contained in:
Arpit Jalan 2016-01-25 13:10:51 +05:30
parent ee823305a1
commit 23c1c5ef19
2 changed files with 4 additions and 1 deletions

View file

@ -6,6 +6,7 @@ export default Ember.Controller.extend(ModalFunctionality, {
// If this isn't defined, it will proxy to the user model on the preferences
// page which is wrong.
emailOrUsername: null,
inviteIcon: "envelope",
isAdmin: function(){
return Discourse.User.currentProp("admin");
@ -88,8 +89,10 @@ export default Ember.Controller.extend(ModalFunctionality, {
if (Ember.isEmpty(this.get('emailOrUsername'))) {
return I18n.t('topic.invite_reply.to_topic_blank');
} else if (Discourse.Utilities.emailValid(this.get('emailOrUsername'))) {
this.set("inviteIcon", "envelope");
return I18n.t('topic.invite_reply.to_topic_email');
} else {
this.set("inviteIcon", "hand-o-right");
return I18n.t('topic.invite_reply.to_topic_username');
}
}

View file

@ -28,7 +28,7 @@
{{#if model.finished}}
{{d-button class="btn-primary" action="closeModal" label="close"}}
{{else}}
{{d-button icon="envelope" action="createInvite" class="btn-primary" disabled=disabled label=buttonTitle}}
{{d-button icon=inviteIcon action="createInvite" class="btn-primary" disabled=disabled label=buttonTitle}}
{{#if showCopyInviteButton}}
{{d-button icon="link" action="generateInvitelink" class="btn-primary" disabled=disabledCopyLink label='user.invited.generate_link'}}
{{/if}}