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

View File

@ -28,7 +28,7 @@
{{#if model.finished}} {{#if model.finished}}
{{d-button class="btn-primary" action="closeModal" label="close"}} {{d-button class="btn-primary" action="closeModal" label="close"}}
{{else}} {{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}} {{#if showCopyInviteButton}}
{{d-button icon="link" action="generateInvitelink" class="btn-primary" disabled=disabledCopyLink label='user.invited.generate_link'}} {{d-button icon="link" action="generateInvitelink" class="btn-primary" disabled=disabledCopyLink label='user.invited.generate_link'}}
{{/if}} {{/if}}