mirror of
https://github.com/discourse/discourse.git
synced 2025-06-06 22:56:01 +08:00
UX: Show first unique letters in invite link (#12434)
This commit is contained in:
@ -34,6 +34,11 @@ const Invite = EmberObject.extend({
|
|||||||
.catch(popupAjaxError);
|
.catch(popupAjaxError);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@discourseComputed("invite_key")
|
||||||
|
shortKey(key) {
|
||||||
|
return key.substr(0, 4) + "...";
|
||||||
|
},
|
||||||
|
|
||||||
@discourseComputed("groups")
|
@discourseComputed("groups")
|
||||||
groupIds(groups) {
|
groupIds(groups) {
|
||||||
return groups ? groups.map((group) => group.id) : [];
|
return groups ? groups.map((group) => group.id) : [];
|
||||||
|
@ -107,7 +107,7 @@
|
|||||||
{{#if invite.email}}
|
{{#if invite.email}}
|
||||||
{{invite.email}}
|
{{invite.email}}
|
||||||
{{else}}
|
{{else}}
|
||||||
{{i18n "user.invited.invited_via_link" count=invite.redemption_count max=invite.max_redemptions_allowed}}
|
{{i18n "user.invited.invited_via_link" key=invite.shortKey count=invite.redemption_count max=invite.max_redemptions_allowed}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</td>
|
</td>
|
||||||
{{#if currentUser.staff}}
|
{{#if currentUser.staff}}
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
class InviteSerializer < ApplicationSerializer
|
class InviteSerializer < ApplicationSerializer
|
||||||
attributes :id,
|
attributes :id,
|
||||||
|
:invite_key,
|
||||||
:link,
|
:link,
|
||||||
:email,
|
:email,
|
||||||
:emailed,
|
:emailed,
|
||||||
|
@ -1448,7 +1448,7 @@ en:
|
|||||||
redeemed_tab: "Redeemed"
|
redeemed_tab: "Redeemed"
|
||||||
redeemed_tab_with_count: "Redeemed (%{count})"
|
redeemed_tab_with_count: "Redeemed (%{count})"
|
||||||
invited_via: "Invitation"
|
invited_via: "Invitation"
|
||||||
invited_via_link: "link (%{count} / %{max} redeemed)"
|
invited_via_link: "link %{key} (%{count} / %{max} redeemed)"
|
||||||
groups: "Groups"
|
groups: "Groups"
|
||||||
topic: "Topic"
|
topic: "Topic"
|
||||||
sent: "Created/Last Sent"
|
sent: "Created/Last Sent"
|
||||||
|
Reference in New Issue
Block a user