invites: "User Label" 2/2

applies label to users. Also hide the user label element on the invite
dropdown when not set.
pull/298/head
Harvey Tindall 1 year ago
parent 7c76b58ab8
commit dae0ad1de5
No known key found for this signature in database
GPG Key ID: BBC65952848FB1A2

@ -310,6 +310,10 @@ func (app *appContext) newUser(req newUserDTO, confirmed bool) (f errorFunc, suc
Contact: (req.Email != ""),
}
if invite.UserLabel != "" {
emailStore.Label = invite.UserLabel
}
var profile Profile
if invite.Profile != "" {
app.debug.Printf("Applying settings from profile \"%s\"", invite.Profile)
@ -338,7 +342,7 @@ func (app *appContext) newUser(req newUserDTO, confirmed bool) (f errorFunc, suc
}
}
// if app.config.Section("password_resets").Key("enabled").MustBool(false) {
if req.Email != "" {
if req.Email != "" || invite.UserLabel != "" {
app.storage.SetEmailsKey(id, emailStore)
}
expiry := time.Time{}

@ -48,9 +48,11 @@ class DOMInvite implements Invite {
if (label) {
labelLabel.textContent = window.lang.strings("userLabel");
value.textContent = label;
value.classList.remove("unfocused");
} else {
labelLabel.textContent = "";
value.textContent = "";
value.classList.add("unfocused");
}
}
@ -366,7 +368,7 @@ class DOMInvite implements Invite {
<p class="supra mb-4 top">${window.lang.strings("inviteDateCreated")} <strong class="inv-created"></strong></p>
<p class="supra mb-4">${window.lang.strings("inviteRemainingUses")} <strong class="inv-remaining"></strong></p>
<p class="supra mb-4"><span class="user-expiry"></span> <strong class="user-expiry-time"></strong></p>
<p class="mb-4 flex items-center"><span class="user-label-label supra mr-2"></span> <span class="user-label chip ~blue"></span></p>
<p class="mb-4 flex items-center"><span class="user-label-label supra mr-2"></span> <span class="user-label chip ~blue unfocused"></span></p>
`;
this._right = document.createElement('div') as HTMLDivElement;

Loading…
Cancel
Save