Skip to content

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

Make badge styles consistent on bounces and templates pages with campaigns.

Kailash Nadh3cc8a6b2b678
diff --git a/static/admin/assets/css/style.css b/static/admin/assets/css/style.css
index c4f7e283..b2a4a74a 100644
--- a/static/admin/assets/css/style.css
+++ b/static/admin/assets/css/style.css
@@ -240,19 +240,18 @@ a:has(> .badge:only-child) {
}
&.status-running,
- &.status-subscribed,
- &.campaign {
+ &.status-subscribed {
--badge-fg: var(--tone-blue);
--badge-bg: var(--tone-blue-bg);
}
- &.status-paused,
- &.tx {
+ &.status-paused {
--badge-fg: var(--tone-violet);
--badge-bg: var(--tone-violet-bg);
}
&.status-scheduled,
+ &.bounce-soft,
&.status-unconfirmed,
&[data-variant="warning"] {
--badge-fg: var(--tone-amber);
@@ -269,6 +268,7 @@ a:has(> .badge:only-child) {
}
&.status-cancelled,
+ &.bounce-hard,
&.status-unsubscribed {
--badge-fg: var(--tone-rose);
--badge-bg: var(--tone-rose-bg);
diff --git a/static/admin/assets/static/icons.svg b/static/admin/assets/static/icons.svg
index 3d2f750f..46b83ac1 100644
--- a/static/admin/assets/static/icons.svg
+++ b/static/admin/assets/static/icons.svg
@@ -203,6 +203,10 @@
<path d="M20.59 13.41l-7.17 7.17a2 2 0 0 1-2.83 0L2 12V2h10l8.59 8.59a2 2 0 0 1 0 2.82z" /><line x1="7" y1="7" x2="7.01" y2="7" />
</symbol>
+ <symbol id="icon-terminal" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
+ <polyline points="4 17 10 11 4 5" /><line x1="12" y1="19" x2="20" y2="19" />
+ </symbol>
+
<symbol id="icon-tool" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" />
</symbol>
diff --git a/static/admin/icons.txt b/static/admin/icons.txt
index 17a7e2da..809c32a0 100644
--- a/static/admin/icons.txt
+++ b/static/admin/icons.txt
@@ -50,6 +50,7 @@ settings
star
sun
tag
+terminal
tool
trash-2
type
diff --git a/static/admin/views/bounces.html b/static/admin/views/bounces.html
index 3d6608a9..626498c9 100644
--- a/static/admin/views/bounces.html
+++ b/static/admin/views/bounces.html
@@ -68,7 +68,7 @@
{{- with .ParsedCampaign }}<a href="{{ $base }}?campaign_id={{ .ID }}" class="unstyled">{{ .Name }}</a>{{ else }}-{{ end }}
</td>
<td data-label="{{ $.L.T "bounces.source" }}"><a href="{{ $base }}?source={{ .Source }}" class="unstyled">{{ .Source }}</a></td>
- <td data-label="{{ $.L.T "globals.fields.type" }}"><a href="{{ $base }}?type={{ .Type }}" class="unstyled" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.T (printf "bounces.%s" .Type) }}">{{ Badge ($.L.T (printf "bounces.%s" .Type)) "enum" }}</a></td>
+ <td data-label="{{ $.L.T "globals.fields.type" }}"><a href="{{ $base }}?type={{ .Type }}" class="unstyled" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.T (printf "bounces.%s" .Type) }}">{{ Badge ($.L.T (printf "bounces.%s" .Type)) (printf "enum bounce-%s" .Type) }}</a></td>
<td class="date-stack" data-label="{{ $.L.T "globals.fields.createdAt" }}">{{ NiceDate .CreatedAt }}</td>
<td class="actions align-right">
<ot-dropdown>
diff --git a/static/admin/views/templates.html b/static/admin/views/templates.html
index 60650369..46173a91 100644
--- a/static/admin/views/templates.html
+++ b/static/admin/views/templates.html
@@ -11,11 +11,11 @@
{{ .L.T "globals.terms.templates" }}
<span>({{ len $d.Templates }})</span>
{{- if $d.Type }}
- {{- $label := $d.Type }}{{ $class := "enum" }}
- {{- if eq $d.Type "tx" }}{{ $label = .L.Tc "globals.terms.tx" 1 }}{{ $class = "enum tx" }}
- {{- else if eq $d.Type "campaign_visual" }}{{ $label = .L.T "campaigns.contentType.visual" }}{{ $class = "enum campaign" }}
- {{- else if eq $d.Type "campaign" }}{{ $label = .L.Tc "globals.terms.campaign" 1 }}{{ $class = "enum campaign" }}{{ end }}
- {{ template "filter-badge" dict "Label" $label "Class" $class "URL" $base }}
+ {{- $label := $d.Type }}
+ {{- if eq $d.Type "tx" }}{{ $label = .L.Tc "globals.terms.tx" 1 }}
+ {{- else if eq $d.Type "campaign_visual" }}{{ $label = .L.T "campaigns.contentType.visual" }}
+ {{- else if eq $d.Type "campaign" }}{{ $label = .L.Tc "globals.terms.campaign" 1 }}{{ end }}
+ {{ template "filter-badge" dict "Label" $label "Class" "enum" "URL" $base }}
{{- end }}
</h1>
</div>
@@ -51,13 +51,13 @@
<td>
<div class="hstack">
{{- if eq .Type "tx" }}
- <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.Tc "globals.terms.tx" 1 }}">{{ Badge ($.L.Tc "globals.terms.tx" 1) "enum tx" }}</a>
+ <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.Tc "globals.terms.tx" 1 }}">{{ Badge (list (Icon "terminal") ($.L.Tc "globals.terms.tx" 1)) "enum" }}</a>
{{- else }}
- <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.Tc "globals.terms.campaign" 1 }}">{{ Badge ($.L.Tc "globals.terms.campaign" 1) "enum campaign" }}</a>
+ <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.Tc "globals.terms.campaign" 1 }}">{{ Badge (list (Icon "send") ($.L.Tc "globals.terms.campaign" 1)) "enum" }}</a>
{{- if eq .Type "campaign_visual" }}
- <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.T "campaigns.contentType.visual" }}">{{ Badge ($.L.T "campaigns.contentType.visual") "enum" }}</a>
+ <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} {{ $.L.T "campaigns.contentType.visual" }}">{{ Badge (list (Icon "eye") ($.L.T "campaigns.contentType.visual")) "enum" }}</a>
{{- else }}
- <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} HTML">{{ Badge "HTML" "enum" }}</a>
+ <a href="{{ $base }}?type={{ .Type }}" title="{{ $.L.T "globals.buttons.view" }} HTML">{{ Badge (list (Icon "code") "HTML") "enum" }}</a>
{{- end }}
{{- end }}
</div>