mirror of
https://github.com/discourse/discourse.git
synced 2025-03-26 12:57:55 +08:00
UX: Minor improvements to invites (#12324)
* FIX: Show resend button only if an email was sent Otherwise, show the "save and send email" button. * UX: Copy change * UX: Show feedback when link was copied
This commit is contained in:
parent
d1cf773730
commit
687e09c885
app
assets/javascripts/discourse/app
serializers
config/locales
@ -146,8 +146,13 @@ export default Controller.extend(
|
||||
},
|
||||
|
||||
@action
|
||||
mutAutogenerated(value) {
|
||||
this.setAutogenerated(value);
|
||||
copied() {
|
||||
this.appEvents.trigger("modal-body:flash", {
|
||||
text: I18n.t("user.invited.invite.invite_copied"),
|
||||
messageClass: "success",
|
||||
});
|
||||
|
||||
this.setAutogenerated(false);
|
||||
},
|
||||
|
||||
@action
|
||||
|
@ -6,7 +6,7 @@
|
||||
class="invite-link"
|
||||
value=invite.link
|
||||
readonly=true}}
|
||||
{{copy-button selector="input.invite-link" copied=(action "mutAutogenerated" false)}}
|
||||
{{copy-button selector="input.invite-link" copied=(action "copied")}}
|
||||
</div>
|
||||
|
||||
<p>{{i18n "user.invited.invite.expires_at_time" time=expiresAtRelative}}</p>
|
||||
@ -98,16 +98,6 @@
|
||||
{{/d-modal-body}}
|
||||
|
||||
<div class="modal-footer">
|
||||
{{#if isEmail}}
|
||||
{{d-button
|
||||
icon="envelope"
|
||||
label=(if changed "user.invited.invite.send_invite_email" "user.invited.reinvite")
|
||||
class="btn-primary"
|
||||
action=(action "saveInvite" true)
|
||||
disabled=disabled
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{d-button
|
||||
icon="link"
|
||||
label="user.invited.invite.save_invite"
|
||||
@ -116,6 +106,16 @@
|
||||
disabled=disabled
|
||||
}}
|
||||
|
||||
{{#if isEmail}}
|
||||
{{d-button
|
||||
icon="envelope"
|
||||
label=(if invite.emailed "user.invited.reinvite" "user.invited.invite.send_invite_email")
|
||||
class="btn-primary"
|
||||
action=(action "saveInvite" true)
|
||||
disabled=disabled
|
||||
}}
|
||||
{{/if}}
|
||||
|
||||
{{d-button
|
||||
label="cancel"
|
||||
class="btn-flat"
|
||||
|
@ -4,6 +4,7 @@ class InviteSerializer < ApplicationSerializer
|
||||
attributes :id,
|
||||
:link,
|
||||
:email,
|
||||
:emailed,
|
||||
:redemption_count,
|
||||
:max_redemptions_allowed,
|
||||
:custom_message,
|
||||
@ -18,6 +19,14 @@ class InviteSerializer < ApplicationSerializer
|
||||
options[:show_emails] && !object.redeemed?
|
||||
end
|
||||
|
||||
def include_emailed?
|
||||
email.present?
|
||||
end
|
||||
|
||||
def emailed
|
||||
object.emailed_status != Invite.emailed_status_types[:not_required]
|
||||
end
|
||||
|
||||
def expired
|
||||
object.expired?
|
||||
end
|
||||
|
@ -1512,12 +1512,13 @@ en:
|
||||
add_to_groups: "Add to groups:"
|
||||
invite_to_topic: "Send to topic on first login:"
|
||||
expires_at: "Expire after:"
|
||||
custom_message: "Send email:"
|
||||
custom_message: "Optional personal message:"
|
||||
|
||||
send_invite_email: "Save and Send Email"
|
||||
save_invite: "Save Invite"
|
||||
|
||||
invite_saved: "Invite was saved."
|
||||
invite_copied: "Invite link was copied."
|
||||
|
||||
bulk_invite:
|
||||
none: "No invitations to display on this page."
|
||||
|
Loading…
x
Reference in New Issue
Block a user