From a39a664525f55846dd5eea52fcc7009867835989 Mon Sep 17 00:00:00 2001 From: tobi <31960611+tsmethurst@users.noreply.github.com> Date: Tue, 15 Nov 2022 10:19:32 +0100 Subject: [feature] Serialize local account role via API, and show it via web view (#1045) * [feature] Add 'role' field to api serialization of local accounts * [chore] Add a bit of license text while I'm here * [frogend] render account role on same line as username in web view of profile * style tweaking on role badges, general profile header layout * profile stats wrapping * don't render standard 'user' role on web view Co-authored-by: f0x --- web/template/profile.tmpl | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'web/template') diff --git a/web/template/profile.tmpl b/web/template/profile.tmpl index 136496cdb..6cb1daf08 100644 --- a/web/template/profile.tmpl +++ b/web/template/profile.tmpl @@ -13,7 +13,11 @@
{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}'s avatar
{{if .account.DisplayName}}{{emojify .account.Emojis (escape .account.DisplayName)}}{{else}}{{.account.Username}}{{end}}
-
@{{.account.Username}}@{{.instance.AccountDomain}}
+
+
@{{ .account.Username }}@{{ .instance.AccountDomain }}
+ {{- /* Only render account role if 1. it's present and 2. it's not equal to the standard 'user' role */ -}} + {{ if and (.account.Role) (ne .account.Role "user") }}
{{ .account.Role }}
{{ end }} +
@@ -21,10 +25,14 @@
-
Joined {{.account.CreatedAt | timestampVague}}
-
Followed by {{.account.FollowersCount}}
-
Following {{.account.FollowingCount}}
-
Posted {{.account.StatusesCount}}
+
+
Joined {{.account.CreatedAt | timestampVague}}
+
Followed by {{.account.FollowersCount}}
+
+
+
Following {{.account.FollowingCount}}
+
Posted {{.account.StatusesCount}}
+

-- cgit v1.3