Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Simplify and standardize generated avatar styles/sizes across viwes.

Kailash Nadhe4d63d1b7b0d
diff --git a/cmd/avatar.go b/cmd/avatar.go
index da093cf3..499f8445 100644
--- a/cmd/avatar.go
+++ b/cmd/avatar.go
@@ -1,108 +1,10 @@
package main
import (
- "crypto/sha256"
- "fmt"
- "html/template"
"strings"
"unicode"
)
-var avatarColors = map[string][]struct {
- light string
- mid string
- dark string
-}{
- "list": {
- {"#e1f7f3", "#78cbbb", "#234a43"},
- {"#e3f7f5", "#80cec6", "#234a47"},
- {"#e4f6f2", "#88cdbb", "#284b42"},
- {"#e0f5f4", "#72c5c2", "#214947"},
- },
- "campaign": {
- {"#eeebff", "#ad9ff5", "#303254"},
- {"#f0eaff", "#b29bf0", "#383052"},
- {"#edeaff", "#a89aee", "#323052"},
- {"#f2ecff", "#ba9feb", "#3c3152"},
- },
- "campaign-template": {
- {"#fff0e9", "#e8ab91", "#573b2f"},
- {"#fceee7", "#dfa58b", "#51392e"},
- {"#fff2e9", "#e9b295", "#573e30"},
- {"#fcece5", "#e2a18a", "#54372d"},
- },
- "campaign-visual-template": {
- {"#f2eaff", "#bf9ce5", "#463154"},
- {"#f5ecff", "#c6a2e8", "#4a3457"},
- {"#efe8fa", "#b698dd", "#403050"},
- {"#f4e9fc", "#c39be0", "#493153"},
- },
- "tx-template": {
- {"#e3f6fa", "#82c9d8", "#254750"},
- {"#e5f5fa", "#8ac5d7", "#294550"},
- {"#e1f5f8", "#79c5d1", "#22474d"},
- {"#e7f7fa", "#91cdd8", "#2b4950"},
- },
- "subscriber": {
- {"#e4f0ff", "#83b8fa", "#203657"},
- {"#e2f3ff", "#85c5f5", "#264356"},
- {"#e5f0ff", "#90b7fa", "#283d57"},
- {"#e1f2ff", "#7ebff9", "#204459"},
- },
- "user": {
- {"#edf7e5", "#a4ce86", "#354b29"},
- {"#eaf5e4", "#98c77f", "#304927"},
- {"#f0f7e6", "#afcf8b", "#3c4d2b"},
- {"#e9f5e7", "#94c58a", "#304a2d"},
- },
- "user-role": {
- {"#faedf2", "#dfa4bb", "#50313e"},
- {"#f9edf3", "#d9a5bf", "#4b3143"},
- {"#fbedf0", "#e2a7b5", "#52343e"},
- {"#f8ecf2", "#d49eb5", "#4c3140"},
- },
- "list-role": {
- {"#fff3df", "#e8be78", "#574222"},
- {"#fff1dc", "#e5b56f", "#553e20"},
- {"#faf3df", "#d9bd78", "#504323"},
- {"#fff0e0", "#e7b582", "#573f28"},
- },
-}
-
-// avatar is the CSS style and the initials of a generated avatar.
-type avatar struct {
- Style template.CSS
- Text string
-}
-
-// makeAvatar generates a "glass" style avatar with a CSS gradient for an object type and seed.
-// It returns the CSS style + initials of the name that can be printed in HTML.
-func makeAvatar(kind, seed, name string) avatar {
- colors, ok := avatarColors[kind]
- if !ok {
- // Default to the user role palette.
- colors = avatarColors["user-role"]
- }
- sum := sha256.Sum256([]byte(kind + ":" + strings.ToLower(strings.TrimSpace(seed))))
-
- // Pick colours.
- var (
- n = len(colors)
- i = int(sum[0]) % n
- one = colors[i]
- two = colors[(i+1+int(sum[1])%3)%n]
- )
-
- // Two hue blobs, a white shimmer on top, inspired by DiceBear's glass style.
- style := fmt.Sprintf("background-color:%s;color:%s;background-image:radial-gradient(circle at %d%% %d%%,#ffffff73,transparent 55%%),radial-gradient(circle at %d%% %d%%,%sa6,transparent %d%%),radial-gradient(circle at %d%% %d%%,%sa6,transparent %d%%)",
- one.light, one.dark,
- 20+int(sum[8])%15, 10+int(sum[9])%15,
- 15+int(sum[2])%30, 15+int(sum[3])%30, one.mid, 85+int(sum[4])%20,
- 55+int(sum[5])%30, 55+int(sum[6])%30, two.mid, 80+int(sum[7])%20)
-
- return avatar{Style: template.CSS(style), Text: makeInitials(name)}
-}
-
// makeInitials returns a two letter abbreviation of the given name.
func makeInitials(name string) string {
words := strings.FieldsFunc(name, func(r rune) bool {
diff --git a/cmd/init.go b/cmd/init.go
index 47ea169e..2e371040 100644
--- a/cmd/init.go
+++ b/cmd/init.go
@@ -1263,7 +1263,7 @@ func initTplFuncs(i *i18n.I18n, u *UrlConfig) template.FuncMap {
return template.HTML(fmt.Sprintf(`<svg class="icon"><use href="%sadmin/static/%s#icon-%s"></use></svg>`, u.RootPath, f, name))
},
// Auto-generated colour gradient CSS avatar.
- "Avatar": makeAvatar,
+ "Initials": makeInitials,
// '●' that is printed inside some badges.
"Dot": func() template.HTML {
return template.HTML(`<span class="dot">&#9679;</span>`)
diff --git a/static/admin/assets/css/style.css b/static/admin/assets/css/style.css
index 2843a059..4ab1c85b 100644
--- a/static/admin/assets/css/style.css
+++ b/static/admin/assets/css/style.css
@@ -357,15 +357,7 @@ a:has(> .badge:only-child) {
white-space: nowrap;
.avatar {
- display: inline-flex;
margin: 0;
-
- img,
- span {
- height: 18px;
- width: 18px;
- font-size: 8px;
- }
}
}
@@ -637,23 +629,112 @@ main {
}
.avatar {
+ --avatar-size: 1.75rem;
+ --avatar-font-size: var(--text-8);
+ --avatar-light: #faedf2;
+ --avatar-mid: #dfa4bb;
+ --avatar-dark: #50313e;
+ --avatar-accent: #d9a5bf;
+
+ display: inline-flex;
+ align-items: center;
+ justify-content: center;
+ flex-shrink: 0;
+ vertical-align: middle;
+ line-height: 1;
+
+ &.small {
+ --avatar-size: 1.25rem;
+ --avatar-font-size: 0.5rem;
+ }
+
+ &.xsmall {
+ --avatar-size: 1rem;
+ --avatar-font-size: 0.5rem;
+ }
+
img,
span {
align-items: center;
display: inline-flex;
- border-radius: 5px;
+ border-radius: 0.3125rem;
justify-content: center;
object-fit: cover;
- height: 28px;
- width: 28px;
+ height: var(--avatar-size);
+ width: var(--avatar-size);
}
span {
- font-size: var(--text-8);
+ font-size: var(--avatar-font-size);
letter-spacing: 0.02em;
}
}
+.avatar-initials {
+ background-color: var(--avatar-light);
+ color: var(--avatar-dark);
+ background-image:
+ radial-gradient(circle at 27% 17%, #ffffff73, transparent 55%),
+ radial-gradient(circle at 30% 30%, color-mix(in srgb, var(--avatar-mid) 65%, transparent), transparent 95%),
+ radial-gradient(circle at 70% 70%, color-mix(in srgb, var(--avatar-accent) 65%, transparent), transparent 90%);
+}
+
+.avatar-list {
+ --avatar-light: #e1f7f3;
+ --avatar-mid: #78cbbb;
+ --avatar-dark: #234a43;
+ --avatar-accent: #80cec6;
+}
+
+.avatar-campaign {
+ --avatar-light: #eeebff;
+ --avatar-mid: #ad9ff5;
+ --avatar-dark: #303254;
+ --avatar-accent: #b29bf0;
+}
+
+.avatar-campaign-template {
+ --avatar-light: #fff0e9;
+ --avatar-mid: #e8ab91;
+ --avatar-dark: #573b2f;
+ --avatar-accent: #dfa58b;
+}
+
+.avatar-campaign-visual-template {
+ --avatar-light: #f2eaff;
+ --avatar-mid: #bf9ce5;
+ --avatar-dark: #463154;
+ --avatar-accent: #c6a2e8;
+}
+
+.avatar-tx-template {
+ --avatar-light: #e3f6fa;
+ --avatar-mid: #82c9d8;
+ --avatar-dark: #254750;
+ --avatar-accent: #8ac5d7;
+}
+
+.avatar-subscriber {
+ --avatar-light: #e4f0ff;
+ --avatar-mid: #83b8fa;
+ --avatar-dark: #203657;
+ --avatar-accent: #85c5f5;
+}
+
+.avatar-user {
+ --avatar-light: #edf7e5;
+ --avatar-mid: #a4ce86;
+ --avatar-dark: #354b29;
+ --avatar-accent: #98c77f;
+}
+
+.avatar-list-role {
+ --avatar-light: #fff3df;
+ --avatar-mid: #e8be78;
+ --avatar-dark: #574222;
+ --avatar-accent: #e5b56f;
+}
+
.avatar-user,
.avatar-subscriber {
img,
@@ -663,13 +744,9 @@ main {
}
.name-stack {
- align-items: flex-start;
+ align-items: center;
display: flex;
gap: var(--space-3);
-
- > .avatar {
- flex-shrink: 0;
- }
}
/* Components */
@@ -693,7 +770,6 @@ main {
}
.avatar {
- flex-shrink: 0;
margin-inline-end: var(--space-1);
}
}
@@ -1123,13 +1199,6 @@ section.lists {
max-width: 16ch;
font-size: var(--text-8);
- .avatar span {
- width: 16px;
- height: 16px;
- font-size: 0.7rem;
- text-align: center;
- }
-
a {
min-width: 0;
display: block;
@@ -1217,13 +1286,6 @@ section.campaigns {
gap: var(--space-2);
max-width: 16ch;
- .avatar span {
- width: 20px;
- height: 20px;
- font-size: 0.5rem;
- font-weight: var(--font-medium);
- }
-
a {
min-width: 0;
display: block;
@@ -1527,12 +1589,6 @@ section.users {
.role-name {
align-items: center;
gap: var(--space-2);
-
- .avatar span {
- width: 20px;
- height: 20px;
- font-size: 10px;
- }
}
td .badge {
diff --git a/static/admin/partials/avatar.html b/static/admin/partials/avatar.html
index 2225cbcb..b4c8a082 100644
--- a/static/admin/partials/avatar.html
+++ b/static/admin/partials/avatar.html
@@ -1,4 +1,3 @@
{{ define "avatar" -}}
-{{- $a := Avatar .Kind .Seed .Name -}}
-<span class="avatar avatar-{{ .Kind }}">{{ if .URL }}<img src="{{ .URL }}" alt="" width="28" height="28" loading="lazy" />{{ else }}<span style="{{ $a.Style }}" aria-hidden="true">{{ $a.Text }}</span>{{ end }}</span>
+<span class="avatar avatar-{{ .Kind }}{{ if .Size }} {{ .Size }}{{ end }}">{{ if .URL }}<img src="{{ .URL }}" alt="" loading="lazy" />{{ else }}<span class="avatar-initials" aria-hidden="true">{{ Initials .Name }}</span>{{ end }}</span>
{{- end }}
diff --git a/static/admin/views/base.html b/static/admin/views/base.html
index bc9a9829..c40ae993 100644
--- a/static/admin/views/base.html
+++ b/static/admin/views/base.html
@@ -55,7 +55,7 @@
{{ with .Data.Profile }}
<ot-dropdown>
<button popovertarget="user-menu" type="button" class="user-nav-button ghost small user-trigger">
- {{ template "avatar" dict "Kind" "user" "Seed" (printf "%d" .ID) "Name" (or .Name .Username) "URL" .Avatar.String }}
+ {{ template "avatar" dict "Kind" "user" "Name" (or .Name .Username) "URL" .Avatar.String }}
<span class="user-label">{{ .Username }}</span>
</button>
<menu popover id="user-menu">
diff --git a/static/admin/views/campaign.html b/static/admin/views/campaign.html
index 86b089a4..6e3ea4ce 100644
--- a/static/admin/views/campaign.html
+++ b/static/admin/views/campaign.html
@@ -22,7 +22,7 @@
<div class="hstack">
<a href="{{ URI "/admin/campaigns" }}" class="back" aria-label="{{ .L.T "globals.buttons.back" }}">{{ Icon "chevron-left" }}</a>
{{- if not $isNew }}
- {{ template "avatar" dict "Kind" "campaign" "Seed" (printf "%d" $c.ID) "Name" $c.Name }}
+ {{ template "avatar" dict "Kind" "campaign" "Name" $c.Name }}
{{- end }}
<h1 class="page-title">
{{- if $isNew }}{{ .L.T "campaigns.newCampaign" }}
diff --git a/static/admin/views/campaigns.html b/static/admin/views/campaigns.html
index 96cd3e27..547b3ddd 100644
--- a/static/admin/views/campaigns.html
+++ b/static/admin/views/campaigns.html
@@ -80,7 +80,7 @@
<td><input name="id" type="checkbox" value="{{ .ID }}"></td>
<td class="name">
<div class="name-stack">
- {{ template "avatar" dict "Kind" "campaign" "Seed" (printf "%d" .ID) "Name" .Name }}
+ {{ template "avatar" dict "Kind" "campaign" "Name" .Name }}
<div class="vstack gap-1">
<div>
<a href="{{ $base }}/{{ .ID }}" class="unstyled">{{ .Name }}</a>
@@ -119,7 +119,7 @@
<ul>
{{- range .ParsedLists }}
<li class="name-stack">
- {{ template "avatar" dict "Kind" "list" "Seed" (printf "%d" .ID) "Name" .Name }}
+ {{ template "avatar" dict "Size" "small" "Kind" "list" "Name" .Name }}
<a href="{{ URI "/admin/subscribers/lists" }}/{{ .ID }}" title="{{ $.L.T "globals.buttons.filter" }} {{ .Name }}" class="unstyled">{{ .Name }}</a>
</li>
{{- end }}
diff --git a/static/admin/views/dashboard.html b/static/admin/views/dashboard.html
index fa3a5129..fc078405 100644
--- a/static/admin/views/dashboard.html
+++ b/static/admin/views/dashboard.html
@@ -84,7 +84,7 @@
<tr>
<td width="55%">
<div class="name-stack">
- {{ template "avatar" dict "Kind" "campaign" "Seed" (printf "%d" .ID) "Name" .Name }}
+ {{ template "avatar" dict "Kind" "campaign" "Name" .Name }}
<div><a href="{{ URI "/admin/campaigns" }}/{{ .ID }}" class="unstyled">{{ .Name }}</a></div>
</div>
</td>
diff --git a/static/admin/views/list.html b/static/admin/views/list.html
index 3567002a..f2cd4c19 100644
--- a/static/admin/views/list.html
+++ b/static/admin/views/list.html
@@ -7,7 +7,7 @@
<header class="page-header">
<div class="hstack gap-1">
<a href="{{ URI "/admin/lists" }}" class="back" aria-label="{{ .L.T "globals.buttons.back" }}">{{ Icon "chevron-left" }}</a>
- {{ if not $d.IsNew }}{{ template "avatar" dict "Kind" "list" "Seed" (printf "%d" $d.List.ID) "Name" $d.List.Name }}{{ end }}
+ {{ if not $d.IsNew }}{{ template "avatar" dict "Kind" "list" "Name" $d.List.Name }}{{ end }}
<h1 class="page-title">{{ if $d.IsNew }}{{ .L.T "lists.newList" }}{{ else }}{{ $d.List.Name }}{{ end }}</h1>
</div>
</header>
diff --git a/static/admin/views/lists.html b/static/admin/views/lists.html
index 6398a6a9..22d0779a 100644
--- a/static/admin/views/lists.html
+++ b/static/admin/views/lists.html
@@ -82,7 +82,7 @@
<td><input name="id" type="checkbox" value="{{ .ID }}"></td>
<td>
<div class="name-stack">
- {{ template "avatar" dict "Kind" "list" "Seed" (printf "%d" .ID) "Name" .Name }}
+ {{ template "avatar" dict "Kind" "list" "Name" .Name }}
<div>
<a href="{{ URI "/admin/lists" }}/{{ .ID }}" class="unstyled">{{ .Name }}</a>
<div class="hstack gap-2 text-8">
diff --git a/static/admin/views/roles.html b/static/admin/views/roles.html
index cc7b529e..701a2c71 100644
--- a/static/admin/views/roles.html
+++ b/static/admin/views/roles.html
@@ -39,7 +39,7 @@
<tr data-testid="role-row" data-id="{{ .ID }}">
<td>
<div class="name-stack">
- {{ template "avatar" dict "Kind" (printf "%s-role" $d.Type) "Seed" (printf "%d" .ID) "Name" .Name }}
+ {{ template "avatar" dict "Kind" (printf "%s-role" $d.Type) "Name" .Name }}
<a href="{{ $base }}/{{ .ID }}" class="unstyled" {{ if eq .ID 1 }}style="font-weight: bold"{{ end}}>
{{ .Name }}
</a>
diff --git a/static/admin/views/subscriber.html b/static/admin/views/subscriber.html
index 59fb1105..4832bc9b 100644
--- a/static/admin/views/subscriber.html
+++ b/static/admin/views/subscriber.html
@@ -13,7 +13,7 @@
<div class="col-6">
<div class="hstack gap-1">
<a href="{{ URI "/admin/subscribers" }}" class="back" aria-label="{{ .L.T "globals.buttons.back" }}">{{ Icon "chevron-left" }}</a>
- {{ if not $d.IsNew }}{{ template "avatar" dict "Kind" "subscriber" "Seed" (printf "%d" $sub.ID) "Name" (or $sub.Name $sub.Email) }}{{ end }}
+ {{ if not $d.IsNew }}{{ template "avatar" dict "Kind" "subscriber" "Name" (or $sub.Name $sub.Email) }}{{ end }}
<h1 class="page-title">
{{- if $d.IsNew }}
{{ .L.T "subscribers.newSubscriber" }}
diff --git a/static/admin/views/subscribers.html b/static/admin/views/subscribers.html
index af6c0492..91972dd8 100644
--- a/static/admin/views/subscribers.html
+++ b/static/admin/views/subscribers.html
@@ -23,7 +23,7 @@
<h1 class="page-title">
{{ .L.T "globals.terms.subscribers" }}
<span>({{ $d.Page.Total }})</span>
- {{- if $d.CurrentList }} {{ template "filter-badge" dict "Label" $d.CurrentList.Name "LabelURL" (printf "%s/%d" (URI "/admin/lists") $d.CurrentList.ID) "Avatar" (dict "Kind" "list" "Seed" (printf "%d" $d.CurrentList.ID) "Name" $d.CurrentList.Name) "URL" (URI "/admin/subscribers") }}{{ end }}
+ {{- if $d.CurrentList }} {{ template "filter-badge" dict "Label" $d.CurrentList.Name "LabelURL" (printf "%s/%d" (URI "/admin/lists") $d.CurrentList.ID) "Avatar" (dict "Size" "xsmall" "Kind" "list" "Name" $d.CurrentList.Name) "URL" (URI "/admin/subscribers") }}{{ end }}
{{- if eq $subStatus "none" }} {{ template "filter-badge" dict "Label" (.L.T "dashboard.orphanSubs") "URL" ($d.Page.FilterURL $base "subscription_status") }}
{{- else if $subStatus }} {{ template "filter-badge" dict "Label" (list (Dot) (.L.T (printf "subscribers.status.%s" $subStatus))) "Class" (printf "status-%s" $subStatus) "URL" ($d.Page.FilterURL $base "subscription_status") }}{{ end }}
{{- if $status }} {{ template "filter-badge" dict "Label" (list (Dot) (.L.T (printf "subscribers.status.%s" $status))) "Class" (printf "status-%s" $status) "URL" ($d.Page.FilterURL $base "status") }}{{ end }}
@@ -104,7 +104,7 @@
<td><input name="id" type="checkbox" value="{{ .ID }}"></td>
<td class="email">
<div class="name-stack">
- {{ template "avatar" dict "Kind" "subscriber" "Seed" (printf "%d" .ID) "Name" (or .Name .Email) }}
+ {{ template "avatar" dict "Kind" "subscriber" "Name" (or .Name .Email) }}
<div>
<a class="unstyled" href="{{ URI "/admin/subscribers" }}/{{ .ID }}">{{ .Email }}</a>
{{- if ne .Status "enabled" }}
@@ -116,7 +116,7 @@
{{- if lt $i 3 }}
<div class="name-stack">
{{- $label := $.L.T (printf "subscribers.status.%s" $l.SubscriptionStatus) }}
- <a class="unstyled avatar avatar-list" href="{{ URI "/admin/subscribers" }}/{{ $sub.ID }}/lists" title="{{ $label }}" aria-label="{{ $l.Name }}: {{ $label }}"><span class="badge enum status-{{ $l.SubscriptionStatus }}" aria-hidden="true">{{ if eq $l.SubscriptionStatus "unconfirmed" }}?{{ else }}{{ Icon (or (index $statusIcons $l.SubscriptionStatus) "help-circle") }}{{ end }}</span></a>
+ <a class="unstyled avatar avatar-list xsmall" href="{{ URI "/admin/subscribers" }}/{{ $sub.ID }}/lists" title="{{ $label }}" aria-label="{{ $l.Name }}: {{ $label }}"><span class="badge enum status-{{ $l.SubscriptionStatus }}" aria-hidden="true">{{ if eq $l.SubscriptionStatus "unconfirmed" }}?{{ else }}{{ Icon (or (index $statusIcons $l.SubscriptionStatus) "help-circle") }}{{ end }}</span></a>
<a class="unstyled" href="{{ URI "/admin/subscribers/lists" }}/{{ $l.ID }}" title="{{ $.L.T "globals.buttons.filter" }} {{ $l.Name }}">{{ $l.Name }}</a>
</div>
{{- end }}
diff --git a/static/admin/views/template.html b/static/admin/views/template.html
index ea84d94d..1a33acd0 100644
--- a/static/admin/views/template.html
+++ b/static/admin/views/template.html
@@ -20,7 +20,7 @@
{{- if not $isNew }}
{{- $kind := "campaign-template" -}}
{{- if eq $t.Type "tx" }}{{ $kind = "tx-template" }}{{ else if eq $t.Type "campaign_visual" }}{{ $kind = "campaign-visual-template" }}{{ end -}}
- {{ template "avatar" dict "Kind" $kind "Seed" (printf "%d" $t.ID) "Name" $t.Name }}
+ {{ template "avatar" dict "Kind" $kind "Name" $t.Name }}
{{- end }}
<h1 class="page-title">
{{- if $isNew }}{{ .L.T "templates.newTemplate" }}{{ else }}{{ $t.Name }}{{ end -}}
diff --git a/static/admin/views/templates.html b/static/admin/views/templates.html
index f5e15966..1fe3bd31 100644
--- a/static/admin/views/templates.html
+++ b/static/admin/views/templates.html
@@ -46,7 +46,7 @@
{{- $kind := "campaign-template" -}}
{{- if eq .Type "tx" }}{{ $kind = "tx-template" }}{{ else if eq .Type "campaign_visual" }}{{ $kind = "campaign-visual-template" }}{{ end -}}
<div class="name-stack">
- {{ template "avatar" dict "Kind" $kind "Seed" (printf "%d" .ID) "Name" .Name }}
+ {{ template "avatar" dict "Kind" $kind "Name" .Name }}
<div>
<a href="{{ $base }}/{{ .ID }}" class="unstyled {{ if .IsDefault }}default{{ end }}" data-testid="btn-edit">{{ .Name }}</a>
{{ if .IsDefault }}{{ Badge ($.L.T "templates.default") }}{{ end }}
diff --git a/static/admin/views/user.html b/static/admin/views/user.html
index a9858ef7..1aaaa4af 100644
--- a/static/admin/views/user.html
+++ b/static/admin/views/user.html
@@ -12,7 +12,7 @@
<header class="page-header">
<div class="hstack gap-1">
<a href="{{ $base }}" class="back" aria-label="{{ .L.T "globals.buttons.back" }}">{{ Icon "chevron-left" }}</a>
- {{- if not $d.IsNew }}{{ template "avatar" dict "Kind" "user" "Seed" (printf "%d" $d.User.ID) "Name" (or $d.User.Name $d.User.Username) "URL" $d.User.Avatar.String }}{{ end }}
+ {{- if not $d.IsNew }}{{ template "avatar" dict "Kind" "user" "Name" (or $d.User.Name $d.User.Username) "URL" $d.User.Avatar.String }}{{ end }}
<h1 class="page-title">
{{- if not $d.IsNew }}{{ $d.User.Name }}{{ else }}{{ .L.T "users.newUser" }}{{ end -}}
</h1>
diff --git a/static/admin/views/users.html b/static/admin/views/users.html
index b0c26c02..ad4ed109 100644
--- a/static/admin/views/users.html
+++ b/static/admin/views/users.html
@@ -75,7 +75,7 @@
{{- end }}
<td>
<div class="name-stack">
- {{ template "avatar" dict "Kind" "user" "Seed" (printf "%d" .ID) "Name" (or .Name .Username) "URL" .Avatar.String }}
+ {{ template "avatar" dict "Kind" "user" "Name" (or .Name .Username) "URL" .Avatar.String }}
<div>
{{- if $d.Can "users:manage" }}
<a href="{{ URI "/admin/users" }}/{{ .ID }}" class="unstyled{{ if eq .Status "disabled" }} text-light{{ end }}">{{ .Username }}</a>
@@ -91,14 +91,14 @@
<td data-label="{{ $.L.T "subscribers.email" }}" class="text-light">{{ if .Email.Valid }}{{ .Email.String }}{{ else }}<span class="text-light">&mdash;</span>{{ end }}</td>
<td data-label="{{ $.L.Tc "users.userRole" 1 }}">
<div class="name-stack role-name">
- {{ template "avatar" dict "Kind" "user-role" "Seed" (printf "%d" .UserRole.ID) "Name" .UserRole.Name }}
+ {{ template "avatar" dict "Size" "small" "Kind" "user-role" "Name" .UserRole.Name }}
<a href="{{ $base }}?user_role_id={{ .UserRole.ID }}" class="unstyled" title="{{ $.L.T "globals.buttons.filter" }} {{ .UserRole.Name }}">{{ .UserRole.Name }}</a>
</div>
</td>
<td data-label="{{ $.L.Tc "users.listRole" 2 }}">
{{- with .ListRole }}
<div class="name-stack role-name">
- {{ template "avatar" dict "Kind" "list-role" "Seed" (printf "%d" .ID) "Name" .Name }}
+ {{ template "avatar" dict "Size" "small" "Kind" "list-role" "Name" .Name }}
<a href="{{ $base }}?list_role_id={{ .ID }}" class="unstyled" title="{{ $.L.T "globals.buttons.filter" }} {{ .Name }}">{{ .Name }}</a>
</div>
{{- else }}