package web import ( "slices" "git.zb-server.de/ZB-Server/uptimesebi/internal/auth" "git.zb-server.de/ZB-Server/uptimesebi/internal/i18n" ) // Role is a built-in or custom role. type Role struct { ID string Name string BuiltIn bool Permissions []string } // Assignment is one role a member holds. type Assignment struct { ID string RoleName string // Scope is empty for organization-wide assignments. Scope string } // Member is a row on the members page. type Member struct { UserID string Email string DisplayName string IsOwner bool Assignments []Assignment } // PendingInvite is an invitation that was not accepted yet. type PendingInvite struct { ID string Email string RoleName string } // MembersView is the data of the members page. type MembersView struct { Members []Member Roles []Role Invitations []PendingInvite CanManage bool } templ settingsHeading(titleID, introID string) {
{ i18n.T(ctx, introID) }
} } templ sectionHeading(id string) {| { i18n.T(ctx, "auth.field.email") } | { i18n.T(ctx, "members.roles") } | |
|---|---|---|
| { m.Email } if m.DisplayName != "" { { m.DisplayName } } |
if m.IsOwner {
{ i18n.T(ctx, "members.owner") }
}
|
if v.CanManage && !m.IsOwner {
{ i18n.T(ctx, "sso.action.edit") } |
| { i18n.T(ctx, "sso.field.name") } | if v.ShowOwner {{ i18n.T(ctx, "tokens.owner") } | }{ i18n.T(ctx, "tokens.expires") } | { i18n.T(ctx, "tokens.last_used") } | |
|---|---|---|---|---|
| { t.Name } { t.Prefix }… | if v.ShowOwner {{ t.UserEmail } | }{ t.ExpiresAt } | { t.LastUsedAt } |
{ i18n.T(ctx, "error.invitation_invalid") }
} else {{ i18n.T(ctx, "invite.summary", "Org", v.OrgName, "Role", v.RoleName) }
{ v.Email }
switch { case v.SignedInAs == v.Email: case v.SignedInAs != "":{ i18n.T(ctx, "error.invitation_email_mismatch") }
case v.AccountExists: { i18n.T(ctx, "invite.sign_in") } default: } } } }