From b32c7df0e9608863d2ff78b7823d636350a69428 Mon Sep 17 00:00:00 2001 From: Dan Ungureanu Date: Mon, 26 Apr 2021 19:08:59 +0300 Subject: [PATCH] FEATURE: Share Topic modal improvements (#12834) This PR includes few commits that improve the new "Share Topic" modal: same icon for notify button as the notification, advanced options are only showed for staff, but the topic name should be visible to everyone. --- .../app/controllers/create-invite.js | 6 ++- .../app/templates/modal/create-invite.hbs | 46 ++++++++++++------- .../app/templates/modal/share-topic.hbs | 2 +- 3 files changed, 35 insertions(+), 19 deletions(-) diff --git a/app/assets/javascripts/discourse/app/controllers/create-invite.js b/app/assets/javascripts/discourse/app/controllers/create-invite.js index d0c5b2b27a3..11262768faa 100644 --- a/app/assets/javascripts/discourse/app/controllers/create-invite.js +++ b/app/assets/javascripts/discourse/app/controllers/create-invite.js @@ -19,8 +19,9 @@ export default Controller.extend( invite: null, invites: null, - autogenerated: false, showAdvanced: false, + limitToEmail: false, + autogenerated: false, type: "link", @@ -32,8 +33,9 @@ export default Controller.extend( this.setProperties({ invite: null, invites: null, - autogenerated: false, showAdvanced: false, + limitToEmail: false, + autogenerated: false, }); this.setInvite(Invite.create()); diff --git a/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs b/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs index 1bb823f2537..4b640844e80 100644 --- a/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs +++ b/app/assets/javascripts/discourse/app/templates/modal/create-invite.hbs @@ -52,15 +52,17 @@ {{#if isEmail}} {{#if showAdvanced}} -
- - {{textarea id="invite-message" value=buffered.custom_message}} -
+ {{#if currentUser.staff}} +
+ + {{textarea id="invite-message" value=buffered.custom_message}} +
+ {{/if}} {{/if}} {{/if}} - {{#if currentUser.staff}} - {{#if showAdvanced}} + {{#if showAdvanced}} + {{#if currentUser.staff}}
{{choose-topic selectedTopicId=buffered.topicId @@ -69,11 +71,21 @@ label="user.invited.invite.invite_to_topic" }}
+ {{else}} +
+ + {{input + name="invite-topic" + class="invite-topic" + value=buffered.topicTitle + readonly=true + }} +
{{/if}} {{/if}} - {{#if currentUser.staff}} - {{#if showAdvanced}} + {{#if showAdvanced}} + {{#if currentUser.staff}}
{{group-chooser @@ -86,8 +98,8 @@ {{/if}} {{/if}} - {{#if currentUser.staff}} - {{#if showAdvanced}} + {{#if showAdvanced}} + {{#if currentUser.staff}}
{{future-date-input displayLabel=(i18n "user.invited.invite.expires_at") @@ -121,10 +133,12 @@ }} {{/if}} - {{d-button - action=(action "toggleAdvanced") - class="show-advanced" - icon="cog" - title=(if showAdvanced "user.invited.invite.hide_advanced" "user.invited.invite.show_advanced") - }} + {{#if currentUser.staff}} + {{d-button + action=(action "toggleAdvanced") + class="show-advanced" + icon="cog" + title=(if showAdvanced "user.invited.invite.hide_advanced" "user.invited.invite.show_advanced") + }} + {{/if}}
diff --git a/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs b/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs index cf9591c80e9..066bdf37514 100644 --- a/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs +++ b/app/assets/javascripts/discourse/app/templates/modal/share-topic.hbs @@ -21,7 +21,7 @@ {{d-button class="btn-primary" label="topic.share.notify_users.title" - icon="users" + icon="hand-point-right" action=(action "toggleNotifyUsers") }}