diff options
author | 2022-11-15 10:19:32 +0100 | |
---|---|---|
committer | 2022-11-15 10:19:32 +0100 | |
commit | a39a664525f55846dd5eea52fcc7009867835989 (patch) | |
tree | 33ba8c86bff8ea31853c1f52a92260d2909edcd4 /web/template | |
parent | [feature] Allow newly uploaded emojis to be placed in categories (#939) (diff) | |
download | gotosocial-a39a664525f55846dd5eea52fcc7009867835989.tar.xz |
[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 <f0x@cthu.lu>
Diffstat (limited to 'web/template')
-rw-r--r-- | web/template/profile.tmpl | 18 |
1 files changed, 13 insertions, 5 deletions
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 @@ <div id="profile-basic-filler2"></div> <a href="{{.account.Avatar}}" class="avatar"><img src="{{.account.Avatar}}" alt="{{if .account.DisplayName}}{{.account.DisplayName}}{{else}}{{.account.Username}}{{end}}'s avatar"></a> <div class="displayname">{{if .account.DisplayName}}{{emojify .account.Emojis (escape .account.DisplayName)}}{{else}}{{.account.Username}}{{end}}</div> - <div class="username">@{{.account.Username}}@{{.instance.AccountDomain}}</div> + <div class="usernamecontainer"> + <div class="username">@{{ .account.Username }}@{{ .instance.AccountDomain }}</div> + {{- /* 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") }}<div class="role {{ .account.Role }}">{{ .account.Role }}</div>{{ end }} + </div> </div> <div class="detailed"> <div class="bio"> @@ -21,10 +25,14 @@ </div> </div> <div class="accountstats"> - <div class="entry">Joined <b>{{.account.CreatedAt | timestampVague}}</b></div> - <div class="entry">Followed by <b>{{.account.FollowersCount}}</b></div> - <div class="entry">Following <b>{{.account.FollowingCount}}</b></div> - <div class="entry">Posted <b>{{.account.StatusesCount}}</b></div> + <div class="entry-group"> + <div class="entry">Joined <b>{{.account.CreatedAt | timestampVague}}</b></div> + <div class="entry">Followed by <b>{{.account.FollowersCount}}</b></div> + </div> + <div class="entry-group"> + <div class="entry">Following <b>{{.account.FollowingCount}}</b></div> + <div class="entry">Posted <b>{{.account.StatusesCount}}</b></div> + </div> </div> </div> <h2 id="recent"> |