From 23c1c5ef19a3483faf05eddcf0f717d90a98d04d Mon Sep 17 00:00:00 2001 From: Arpit Jalan Date: Mon, 25 Jan 2016 13:10:51 +0530 Subject: [PATCH] UX: change glyph when inviting existing user to a topic --- app/assets/javascripts/discourse/controllers/invite.js.es6 | 3 +++ app/assets/javascripts/discourse/templates/modal/invite.hbs | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/assets/javascripts/discourse/controllers/invite.js.es6 b/app/assets/javascripts/discourse/controllers/invite.js.es6 index d22217b56..fe6c83af4 100644 --- a/app/assets/javascripts/discourse/controllers/invite.js.es6 +++ b/app/assets/javascripts/discourse/controllers/invite.js.es6 @@ -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'); } } diff --git a/app/assets/javascripts/discourse/templates/modal/invite.hbs b/app/assets/javascripts/discourse/templates/modal/invite.hbs index a5ccb897f..0a016002d 100644 --- a/app/assets/javascripts/discourse/templates/modal/invite.hbs +++ b/app/assets/javascripts/discourse/templates/modal/invite.hbs @@ -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}}