Skip to content

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

Add a new list overview page.

Kailash Nadhab626a2bfb64
diff --git a/cmd/campaigns.go b/cmd/campaigns.go
index e1202bd1..c472b44f 100644
--- a/cmd/campaigns.go
+++ b/cmd/campaigns.go
@@ -212,7 +212,7 @@ func (a *App) ViewCampaigns(c echo.Context) error {
}
// getViewCampaigns queries paginated campaigns for the HTML list view.
-func (a *App) getViewCampaigns(c echo.Context) ([]models.Campaign, models.PageProps, error) {
+func (a *App) getViewCampaigns(c echo.Context, listIDs ...int) ([]models.Campaign, models.PageProps, error) {
q := makeQuery(c.Request().URL.Query(), campaignsQueryDefaults)
// Get the authenticated user.
@@ -226,6 +226,10 @@ func (a *App) getViewCampaigns(c echo.Context) ([]models.Campaign, models.PagePr
hasAllPerm, permittedLists = user.GetPermittedLists(auth.PermTypeGet | auth.PermTypeManage)
}
+ if len(listIDs) > 0 {
+ hasAllPerm, permittedLists = false, listIDs
+ }
+
// Run the DB query.
pg := a.pg.NewFromURL(q)
res, total, err := a.core.QueryCampaigns(q.Get("query"), q["status"], q["tag"], q.Get("type"),
diff --git a/cmd/handlers.go b/cmd/handlers.go
index f82d105b..520c8209 100644
--- a/cmd/handlers.go
+++ b/cmd/handlers.go
@@ -85,6 +85,7 @@ func initHTTPHandlers(e *echo.Echo, a *App) {
g.GET(path.Join(uriAdmin, "/lists"), a.ViewLists)
g.GET(path.Join(uriAdmin, "/lists/new"), pm(a.ViewNewList, "lists:manage_all"))
g.GET(path.Join(uriAdmin, "/lists/:id"), hasID(a.ViewList))
+ g.GET(path.Join(uriAdmin, "/lists/:id/edit"), hasID(a.ViewList))
g.GET(path.Join(uriAdmin, "/lists/forms"), a.ViewForms)
g.GET(path.Join(uriAdmin, "/campaigns"), pm(a.ViewCampaigns, "campaigns:get_all", "campaigns:get"))
g.GET(path.Join(uriAdmin, "/campaigns/media"), pm(a.ViewMedia, "media:get"))
diff --git a/cmd/lists.go b/cmd/lists.go
index 81c9e6e6..67452f13 100644
--- a/cmd/lists.go
+++ b/cmd/lists.go
@@ -36,8 +36,11 @@ type listsView struct {
type listView struct {
adminView
- IsNew bool
- List models.List
+ IsNew bool
+ Tab string
+ List models.List
+ Campaigns []models.Campaign
+ Page models.PageProps
}
// publicListForm is the minimal list representation used by the forms view.
@@ -96,7 +99,7 @@ func (a *App) ViewNewList(c echo.Context) error {
return c.Render(http.StatusOK, "admin-list", data)
}
-// ViewList renders the HTML view for editing a list.
+// ViewList renders the list overview and editor.
func (a *App) ViewList(c echo.Context) error {
user := auth.GetUser(c)
@@ -111,9 +114,22 @@ func (a *App) ViewList(c echo.Context) error {
return err
}
+ tab := "list"
+ if strings.HasSuffix(c.Path(), "/edit") {
+ tab = "edit"
+ }
+
data := listView{
adminView: newAdminView(c, list.Name+" / "+a.i18n.T("globals.terms.lists"), "", "lists.all"),
List: list,
+ Tab: tab,
+ }
+
+ if tab == "list" && data.Can("campaigns:get", "campaigns:get_all") {
+ data.Campaigns, data.Page, err = a.getViewCampaigns(c, id)
+ if err != nil {
+ return err
+ }
}
return c.Render(http.StatusOK, "admin-list", data)
diff --git a/static/admin/assets/css/style.css b/static/admin/assets/css/style.css
index 44d57c78..c089dd8f 100644
--- a/static/admin/assets/css/style.css
+++ b/static/admin/assets/css/style.css
@@ -195,7 +195,7 @@ ot-tabs:not(:defined) {
}
[role="tablist"][data-variant="primary"] {
- margin-bottom: var(--space-4);
+ margin-bottom: var(--space-6);
background-color: light-dark(#ededee, var(--muted));
}
@@ -1239,6 +1239,20 @@ section.dashboard {
/* Lists */
section.lists {
+ td.list-name {
+ max-width: 0;
+
+ > .avatar {
+ display: flex;
+ }
+
+ .description {
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ }
+ }
+
.subscriber-breakdown {
margin-top: var(--space-2);
diff --git a/static/admin/assets/js/views/lists.js b/static/admin/assets/js/views/lists.js
index 2093d4c7..54b46102 100644
--- a/static/admin/assets/js/views/lists.js
+++ b/static/admin/assets/js/views/lists.js
@@ -32,7 +32,7 @@ function component(list = null) {
// Event handlers.
async onSubmitNew() {
const data = await api('lists.save', '/lists', 'POST', this._payload());
- u.redirect(`${urls.admin}/lists`, { message: i18n.ts('globals.messages.created', { name: data.name }) });
+ u.redirect(`${urls.admin}/lists/${data.id}`, { message: i18n.ts('globals.messages.created', { name: data.name }) });
},
async onSubmitUpdate() {
diff --git a/static/admin/partials/campaigns-table.html b/static/admin/partials/campaigns-table.html
new file mode 100644
index 00000000..ad37cd90
--- /dev/null
+++ b/static/admin/partials/campaigns-table.html
@@ -0,0 +1,194 @@
+{{ define "campaigns-table" -}}
+{{- $root := .Root -}}
+{{- $d := $root.Data -}}
+{{- $readonly := .Readonly -}}
+{{- $base := URI "/admin/campaigns" -}}
+{{- $tableBase := .Base -}}
+<div class="table-wrapper" x-data="table({ query: {{ ToJSON $d.Page.Query }}, filters: {{ ToJSON $d.Page.QueryParams }}, total: {{ $d.Page.Total }} })" :aria-busy="isLoading('campaigns')" @change="onChange($event)">
+ {{- if and (not $readonly) ($d.Can "campaigns:manage" "campaigns:manage_all") }}
+ <template x-if="numSelected > 0">
+ <ot-dropdown class="bulk-actions" data-variant="primary">
+ <button popovertarget="camp-bulk-actions" type="button" class="small" data-cy="btn-bulk-actions">
+ <span x-text="numSelectedLabel"></span> {{ Icon "more-vertical" }}
+ </button>
+ <menu popover id="camp-bulk-actions">
+ {{- if gt $d.Page.Total $d.Page.PerPage }}
+ <button type="button" role="menuitem" class="ghost" data-cy="select-all-campaigns" x-cloak x-show="!allSelected" @click.prevent="onSelectAllQuery()">
+ {{ Icon "check-square" }} <span x-text="selectAllLabel"></span>
+ </button>
+ {{- end }}
+ <button type="button" role="menuitem" class="ghost" data-variant="danger" data-cy="btn-delete-campaigns" :disabled="isLoading('campaigns')" @click.prevent="onDeleteSelected(numSelected, selectedQueryParams().toString())">
+ {{ Icon "trash-2" }} {{ $root.L.T "globals.buttons.delete" }} <span x-text="numSelected"></span>
+ </button>
+ </menu>
+ </ot-dropdown>
+ </template>
+ {{- end }}
+
+ <table{{ if not $readonly }} class="has-select"{{ end }}>
+ <thead>
+ <tr>
+ {{ if not $readonly }}<th width="5%"><input type="checkbox" aria-label="{{ $root.L.T "globals.buttons.toggleSelect" }}"></th>{{ end }}
+ <th width="38%" class="cy-name">{{ $d.Page.SortLink $tableBase "name" ($root.L.T "globals.fields.name") }}</th>
+ <th width="12%" class="cy-type">{{ $root.L.T "globals.fields.status" }}</th>
+ <th width="12%">{{ $root.L.T "campaigns.stats" }}</th>
+ <th width="10%">{{ $root.L.T "globals.terms.analytics" }}</th>
+ <th width="18%" class="cy-timestamp">{{ $d.Page.SortLink $tableBase "created_at" ($root.L.T "campaigns.timestamps") }}</th>
+ <th width="5%" class="align-right"></th>
+ </tr>
+ </thead>
+ <tbody>
+ {{- range $d.Campaigns }}
+ {{- $canStart := and (eq .Status "draft") (not .SendAt.Valid) -}}
+ {{- $canSchedule := and (eq .Status "draft") .SendAt.Valid -}}
+ {{- $canPause := eq .Status "running" -}}
+ {{- $canResume := eq .Status "paused" -}}
+ {{- $canCancel := or (eq .Status "running") (eq .Status "paused") -}}
+ {{- $isDone := or (eq .Status "finished") (eq .Status "cancelled") -}}
+ {{- $hasEnded := and (or $isDone $canResume) .StartedAt.Valid .UpdatedAt.Valid -}}
+ <tr data-campaign-id="{{ .ID }}" class="status-{{ .Status }}">
+ {{ if not $readonly }}<td><input name="id" type="checkbox" value="{{ .ID }}"></td>{{ end }}
+ <td class="name">
+ <div class="avatar{{ if eq .Status "cancelled" }} disabled{{ end }}">
+ {{ template "avatar-icon" dict "Kind" "campaign" "Name" .Name }}
+ <div class="avatar-label vstack gap-1">
+ <div>
+ <a href="{{ $base }}/{{ .ID }}" class="unstyled">{{ .Name }}</a>
+ {{- if eq .Type "optin" }}
+ <a href="{{ $tableBase }}?{{ $d.Page.Encode "type" "page" }}&type=optin" title="{{ $root.L.T "globals.buttons.filter" }} {{ $root.L.T "lists.optin" }}">{{ Badge (list (Icon "user-check") ($root.L.T "lists.optin")) "small outline" }}</a>
+ {{- end }}
+ <div class="subject text-8 text-light">
+ <a href="{{ $base }}/{{ .ID }}" class="unstyled">{{ .Subject }}</a>
+ </div>
+ </div>
+ {{- if .Tags }}
+ <div class="hstack gap-2 text-8">
+ {{ range .Tags }}<a href="?{{ $d.Page.Encode "tag" "page" }}&tag={{ . }}" title="{{ $root.L.T "globals.buttons.filter" }} {{ . }}" class="tag">#{{ . }}</a>{{ end }}
+ </div>
+ {{- end }}
+ {{- if .ParsedLists }}
+ <div class="hstack lists">
+ {{- range $i, $l := .ParsedLists }}
+ {{- if lt $i 3 }}
+ <div class="avatar xsmall">
+ {{ template "avatar-icon" dict "Kind" "list" "Name" .Name "Href" (printf "%s/%d" (URI "/admin/lists") .ID) "Title" (printf "%s %s" ($root.L.T "globals.buttons.view") .Name) }}
+ <a class="unstyled text-light avatar-label" href="{{ URI "/admin/subscribers/lists" }}/{{ .ID }}" title="{{ $root.L.T "globals.buttons.filter" }} {{ .Name }}">{{ .Name }}</a>
+ </div>
+ {{- end }}
+ {{- end }}
+ {{- if gt (len .ParsedLists) 3 }}
+ <ot-dropdown>
+ <button type="button" class="ghost small text-8" popovertarget="camp-lists-{{ .ID }}" aria-label="{{ $root.L.T "globals.terms.lists" }}">+{{ sub (len .ParsedLists) 3 }} {{ $root.L.T "globals.terms.lists" | lower }}</button>
+ <menu popover id="camp-lists-{{ .ID }}">
+ {{- range slice .ParsedLists 3 }}
+ <a role="menuitem" class="button ghost" href="{{ URI "/admin/subscribers/lists" }}/{{ .ID }}" title="{{ $root.L.T "globals.buttons.filter" }} {{ .Name }}">
+ <span class="avatar xsmall">
+ {{ template "avatar-icon" dict "Kind" "list" "Name" .Name }}
+ <span class="avatar-label text-light">{{ .Name }}</span>
+ </span>
+ </a>
+ {{- end }}
+ </menu>
+ </ot-dropdown>
+ {{- end }}
+ </div>
+ {{- end }}
+ </div>
+ </div>
+ </td>
+ <td class="type">
+ <div class="vstack gap-1">
+ <a href="{{ $tableBase }}?{{ $d.Page.Encode "status" "page" }}&status={{ .Status }}" title="{{ $root.L.T "globals.buttons.filter" }} {{ $root.L.T (printf "campaigns.status.%s" .Status) }}">
+ {{ Badge (list (Dot) ($root.L.T (printf "campaigns.status.%s" .Status))) (printf "enum status-%s" .Status) }}
+ {{- if eq .Status "running" }}<span class="spinner" data-spinner="small" aria-busy="true"></span>{{ end }}
+ </a>
+ {{- if and (eq .Status "scheduled") .SendAt.Valid }}
+ <span class="text-8 text-light" title="{{ ExactDate .SendAt }}">{{ Icon "clock" }} {{ CompactDate .SendAt true true }}</span>
+ {{- end }}
+ </div>
+ </td>
+ <td class="stats" data-label="{{ $root.L.T "campaigns.stats" }}">
+ <div class="vstack gap-1">
+ <div><div data-sent-count{{ if eq .Sent 0 }} hidden{{ end }}><span data-stat="sent">{{ FormatNumber .Sent }}</span>{{ if and .ToSend (not (eq .Status "finished")) }} / <span data-stat="to_send">{{ FormatNumber .ToSend }}</span>{{ end }}</div><span class="text-8 text-light"><span data-stat="percent">{{ if .ToSend }}{{ div (mul .Sent 100) .ToSend }}{{ else }}0{{ end }}%</span> {{ $root.L.T "campaigns.sent" | lower }}{{ with Duration .StartedAt .UpdatedAt }} · {{ . }}{{ end }}</span></div>
+ <div><a class="unstyled" href="{{ URI "/admin/subscribers/bounces" }}?campaign_id={{ .ID }}">{{ FormatNumber .Bounces }} <span class="text-8 text-light">{{ $root.L.T "globals.terms.bounces" | lower }}</span></a></div>
+ {{- if eq .Status "running" }}
+ <div class="hstack gap-1 text-8 campaign-progress">
+ <progress data-stat="progress" value="{{ .Sent }}" max="{{ max .ToSend 1 }}" aria-label="{{ $root.L.T "campaigns.progress" }}"></progress>
+ <span><span data-stat="rate">0</span> <span class="text-light">/ {{ $root.L.T "campaigns.rateMinuteShort" }}</span></span>
+ </div>
+ {{- end }}
+ </div>
+ </td>
+ <td class="stats analytics" data-label="{{ $root.L.T "globals.terms.analytics" }}">
+ <div class="vstack gap-1">
+ <div>{{ FormatNumber .Views }} <span class="text-8 text-light">{{ $root.L.T "campaigns.views" | lower }}</span></div>
+ <div>{{ FormatNumber .Clicks }} <span class="text-8 text-light">{{ $root.L.T "campaigns.clicks" | lower }}</span></div>
+ </div>
+ </td>
+ <td class="timestamp" data-label="{{ $root.L.T "campaigns.timestamps" }}">
+ {{- $timeline := printf "%s: %s" ($root.L.T "globals.fields.createdAt") (ExactDate .CreatedAt) }}
+ {{- if .SendAt.Valid }}{{ $timeline = printf "%s\n%s: %s" $timeline ($root.L.T "campaigns.status.scheduled") (ExactDate .SendAt) }}{{ end }}
+ {{- if .StartedAt.Valid }}{{ $timeline = printf "%s\n%s: %s" $timeline ($root.L.T "campaigns.startedAt") (ExactDate .StartedAt) }}{{ end }}
+ {{- if $hasEnded }}
+ {{- $timeline = printf "%s\n%s: %s" $timeline ($root.L.T "campaigns.ended") (ExactDate .UpdatedAt) }}
+ {{- end }}
+ {{- with Duration .StartedAt .UpdatedAt }}{{ $timeline = printf "%s\n%s: %s" $timeline ($root.L.T "settings.performance.slidingWindowDuration") . }}{{ end }}
+ <span tabindex="0" title="{{ $timeline }}" @click="$el.focus()" data-tooltip-placement="bottom">
+ {{- if $hasEnded }}
+ {{ FormatTimestamps .StartedAt .UpdatedAt }}
+ {{- else if and (not (or (eq .Status "draft") (eq .Status "scheduled"))) .StartedAt.Valid }}
+ {{ CompactDate .StartedAt true }} <span class="text-8 text-light">{{ $root.L.T "campaigns.startedAt" | lower }}</span>
+ {{- else }}
+ {{ NiceDate .CreatedAt }}
+ {{- end }}
+ </span>
+ </td>
+ <td class="actions align-right">
+ <ot-dropdown>
+ <button popovertarget="camp-actions-{{ .ID }}" type="button" class="ghost more icon" aria-label="{{ $root.L.T "globals.buttons.more" }}">
+ {{ Icon "more-vertical" }}
+ </button>
+ <menu popover id="camp-actions-{{ .ID }}">
+ <button type="button" role="menuitem" class="ghost" data-cy="btn-preview" @click.prevent="onPreview({{ .ID }}, {{ ToJSON .Name }})">{{ Icon "eye" }} {{ $root.L.T "campaigns.preview" }}</button>
+ {{- if and (not $readonly) ($d.Can "campaigns:send") $canStart }}
+ <button type="button" role="menuitem" class="ghost" data-cy="btn-start" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'running')">{{ Icon "send" }} {{ $root.L.T "campaigns.start" }}</button>
+ {{- end }}
+ {{- if and (not $readonly) ($d.Can "campaigns:send") }}
+ {{- if $canSchedule }}
+ <button type="button" role="menuitem" class="ghost" data-cy="btn-schedule" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'scheduled', true)">{{ Icon "clock" }} {{ $root.L.T "campaigns.schedule" }}</button>
+ {{- end }}
+ {{- if $canPause }}
+ <button type="button" role="menuitem" class="ghost" data-cy="btn-pause" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'paused')">{{ Icon "pause" }} {{ $root.L.T "campaigns.pause" }}</button>
+ {{- end }}
+ {{- if $canResume }}
+ <button type="button" role="menuitem" class="ghost" data-cy="btn-resume" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'running')">{{ Icon "send" }} {{ $root.L.T "campaigns.send" }}</button>
+ {{- end }}
+ {{- if $canCancel }}
+ <button type="button" role="menuitem" class="ghost" data-variant="danger" data-cy="btn-cancel" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'cancelled')">{{ Icon "x-circle" }} {{ $root.L.T "globals.buttons.cancel" }}</button>
+ {{- end }}
+ {{- end }}
+ <hr />
+ <a href="{{ $base }}/{{ .ID }}" role="menuitem" class="button ghost" data-cy="btn-edit">{{ Icon "edit-2" }} {{ $root.L.T "globals.buttons.edit" }}</a>
+ {{- if and (not $readonly) ($d.Can "campaigns:manage" "campaigns:manage_all") }}
+ <button type="button" role="menuitem" class="ghost" data-cy="btn-clone" @click.prevent="onClone({{ .ID }}, {{ ToJSON .Name }})">{{ Icon "copy" }} {{ $root.L.T "globals.buttons.clone" }}</button>
+ {{- end }}
+ {{- if $d.Can "campaigns:get_analytics" }}
+ <a href="{{ URI "/admin/campaigns/analytics" }}?id={{ .ID }}" role="menuitem" class="button ghost" data-cy="btn-analytics">{{ Icon "bar-chart-2" }} {{ $root.L.T "globals.terms.analytics" }}</a>
+ {{- end }}
+ {{- if and (not $readonly) ($d.Can "campaigns:manage" "campaigns:manage_all") }}
+ <hr />
+ <button type="button" role="menuitem" class="ghost" data-variant="danger" data-cy="btn-delete" :disabled="isLoading('campaigns')" @click.prevent="onDelete({{ .ID }}, {{ ToJSON .Name }})">{{ Icon "trash-2" }} {{ $root.L.T "globals.buttons.delete" }}</button>
+ {{- end }}
+ </menu>
+ </ot-dropdown>
+ </td>
+ </tr>
+ {{- else }}
+ {{ if $readonly }}{{ template "empty-state" 6 }}{{ else }}{{ template "empty-state" 7 }}{{ end }}
+ {{- end }}
+ </tbody>
+ </table>
+
+ {{- template "pagination" $d.Page.Pagination }}
+</div>
+{{ end }}
diff --git a/static/admin/partials/list-form.html b/static/admin/partials/list-form.html
index 18affe73..5c1859b8 100644
--- a/static/admin/partials/list-form.html
+++ b/static/admin/partials/list-form.html
@@ -43,17 +43,7 @@
<small data-hint>{{ $root.L.T "lists.archivedHelp" }}</small>
</label>
</section>
- <footer class="hstack justify-between mt-6">
- <div class="hstack gap-1">
- {{- if not .IsNew }}
- <button type="button" class="small" data-variant="secondary" title="{{ $root.L.T "globals.messages.clickToCopy" }}" aria-label="{{ $root.L.T "globals.fields.id" }}" @click="copyToClipboard(form.id)">
- <strong>{{ $root.L.T "globals.fields.id" }}</strong> <span x-text="form.id"></span>
- </button>
- <button type="button" class="small" data-variant="secondary" title="{{ $root.L.T "globals.messages.clickToCopy" }}" aria-label="{{ $root.L.T "globals.fields.uuid" }}" @click="copyToClipboard(form.uuid)">
- <strong>{{ $root.L.T "globals.fields.uuid" }}</strong> <span x-text="form.uuid"></span>
- </button>
- {{- end }}
- </div>
+ <footer class="hstack justify-end mt-6">
<div class="hstack gap-3 justify-end">
{{- if $canSave }}
<button type="submit" data-variant="primary" data-testid="btn-save" data-spinner="small" :disabled="isLoading('lists.save')" :aria-busy="isLoading('lists.save')">{{ $root.L.T "globals.buttons.save" }}</button>
diff --git a/static/admin/partials/list-info.html b/static/admin/partials/list-info.html
new file mode 100644
index 00000000..375e702a
--- /dev/null
+++ b/static/admin/partials/list-info.html
@@ -0,0 +1,94 @@
+{{ define "list-info" -}}
+{{- $d := .Data -}}
+{{- $l := $d.List -}}
+{{- $base := printf "%s/%d" (URI "/admin/lists") $l.ID -}}
+{{- $subs := printf "%s/%d" (URI "/admin/subscribers/lists") $l.ID -}}
+<div class="vstack gap-6">
+ <div class="card">
+ <div class="row">
+ <div class="col-3">
+ <div class="hstack gap-2">
+ {{- $typeIcon := "eye-off" }}{{ if eq $l.Type "public" }}{{ $typeIcon = "eye" }}{{ end }}
+ <a href="{{ URI "/admin/lists" }}?type={{ $l.Type }}" title="{{ .L.T "globals.buttons.filter" }} {{ .L.T (printf "lists.types.%s" $l.Type) }}">{{ Badge (list (Icon $typeIcon) (.L.T (printf "lists.types.%s" $l.Type))) (printf "enum type-%s" $l.Type) }}</a>
+ {{- $icon := "user-x" }}{{ if eq $l.Optin "double" }}{{ $icon = "user-check" }}{{ end }}
+ <a href="{{ URI "/admin/lists" }}?optin={{ $l.Optin }}" title="{{ .L.T "globals.buttons.filter" }} {{ .L.T (printf "lists.optins.%s" $l.Optin) }}">{{ Badge (list (Icon $icon) (.L.T (printf "lists.optins.%s" $l.Optin))) "enum" }}</a>
+ {{ if eq $l.Status "archived" }}{{ Badge (.L.T "lists.archived") "enum status-archived" }}{{ end }}
+ </div>
+ </div>
+ <div class="col-9">
+ {{ if or $l.Description $l.Tags }}
+ <p class="text-small text-light mb-2">
+ {{ $l.Description }}
+ {{ range $l.Tags }} <a href="{{ URI "/admin/lists" }}?tag={{ . }}" class="tag" title="{{ $.L.T "globals.buttons.filter" }} {{ . }}">#{{ . }}</a>{{ end }}
+ </p>
+ {{ end }}
+ <div class="hstack gap-2 justify-end">
+ <button type="button" class="small" data-variant="secondary" title="{{ .L.T "globals.messages.clickToCopy" }}" aria-label="{{ .L.T "globals.fields.id" }}" @click="copyToClipboard(form.id)">
+ <strong>{{ .L.T "globals.fields.id" }}</strong> <span x-text="form.id"></span>
+ </button>
+ <button type="button" class="small" data-variant="secondary" title="{{ .L.T "globals.messages.clickToCopy" }}" aria-label="{{ .L.T "globals.fields.uuid" }}" @click="copyToClipboard(form.uuid)">
+ <strong>{{ .L.T "globals.fields.uuid" }}</strong> <span x-text="form.uuid"></span>
+ </button>
+ </div>
+ </div>
+ </div>
+ </div>
+ <section class="row">
+ <div class="col-3">
+ <article class="card float stat-card">
+ <h4 class="title text-light">{{ Icon "at-sign" }} {{ .L.T "globals.terms.subscribers" }}</h4>
+ <div class="stat-value"><a href="{{ $subs }}" class="unstyled">{{ FormatNumber $l.SubscriberCount }}</a></div>
+ </article>
+ </div>
+ {{ range list "confirmed" "unconfirmed" "unsubscribed" }}
+ <div class="col-3">
+ <article class="card float stat-card">
+ <h4 class="title text-light">{{ $.L.T (printf "subscribers.status.%s" .) }}</h4>
+ <div class="stat-value"><a href="{{ $subs }}?subscription_status={{ . }}" class="unstyled">{{ FormatNumber (index $l.SubscriberCounts .) }}</a></div>
+ </article>
+ </div>
+ {{ end }}
+ </section>
+ <section class="row">
+ <div class="col-6">
+ <article class="card float">
+ <h5 class="title">{{ .L.Tc "globals.terms.subscriptions" 2 }}</h5>
+ <div class="chart-box"><canvas id="chart-subscriptions" role="img" aria-label="{{ .L.Tc "globals.terms.subscriptions" 2 }}"></canvas></div>
+ </article>
+ </div>
+ {{ if $d.CanViewCampaignCharts }}
+ <div class="col-6">
+ <article class="card float">
+ <h5 class="title">{{ .L.T "dashboard.campaignViews" }}</h5>
+ <div class="chart-box"><canvas id="chart-list-views" role="img" aria-label="{{ .L.T "dashboard.campaignViews" }}"></canvas></div>
+ </article>
+ </div>
+ {{ end }}
+ </section>
+ {{ if $d.CacheSlowQueries }}
+ <p class="text-small text-light">{{ .L.T "globals.messages.slowQueriesCached" }}</p>
+ {{ end }}
+ <script>window._listCharts = {{ ToJSON $d.Charts }};</script>
+ {{ if $d.Can "campaigns:get" "campaigns:get_all" }}
+ <section class="campaigns" x-data="campaignsView">
+ <article class="card float page-content has-table">
+ <h5 class="title">{{ .L.T "globals.terms.campaigns" }} ({{ $d.Page.Total }})</h5>
+ <!-- <header class="align-right">
+ <form method="get" action="{{ $base }}" class="search-form">
+ {{ $d.Page.FormFields "query" "page" }}
+ <fieldset class="group">
+ <input name="query" aria-label="{{ .L.T "globals.buttons.search" }}" placeholder="{{ .L.T "campaigns.queryPlaceholder" }}" value="{{ $d.Page.Query }}" />
+ <button type="submit" class="outline external" aria-label="{{ .L.T "globals.buttons.search" }}">{{ Icon "search" }}</button>
+ </fieldset>
+ </form>
+ </header> -->
+ {{ if or ($d.Page.Param "status") ($d.Page.Param "type") ($d.Page.Param "tag") $d.Page.Query }}
+ <p><a href="{{ $base }}">{{ .L.T "globals.buttons.clear" }}</a></p>
+ {{ end }}
+ {{ template "campaigns-table" dict "Root" . "Base" $base "Readonly" true }}
+ </article>
+ {{ template "campaign-preview" . }}
+ </section>
+ {{ end }}
+</div>
+{{ end }}
diff --git a/static/admin/views/campaigns.html b/static/admin/views/campaigns.html
index 64033970..59539b56 100644
--- a/static/admin/views/campaigns.html
+++ b/static/admin/views/campaigns.html
@@ -35,193 +35,7 @@
</header>
<div class="card page-content has-table">
- <div class="table-wrapper" x-data="table({ query: {{ ToJSON $d.Page.Query }}, filters: {{ ToJSON $d.Page.QueryParams }}, total: {{ $d.Page.Total }} })" :aria-busy="isLoading('campaigns')" @change="onChange($event)">
- {{- if $d.Can "campaigns:manage" "campaigns:manage_all" }}
- <template x-if="numSelected > 0">
- <ot-dropdown class="bulk-actions" data-variant="primary">
- <button popovertarget="camp-bulk-actions" type="button" class="small" data-cy="btn-bulk-actions">
- <span x-text="numSelectedLabel"></span> {{ Icon "more-vertical" }}
- </button>
- <menu popover id="camp-bulk-actions">
- {{- if gt $d.Page.Total $d.Page.PerPage }}
- <button type="button" role="menuitem" class="ghost" data-cy="select-all-campaigns" x-cloak x-show="!allSelected" @click.prevent="onSelectAllQuery()">
- {{ Icon "check-square" }} <span x-text="selectAllLabel"></span>
- </button>
- {{- end }}
- <button type="button" role="menuitem" class="ghost" data-variant="danger" data-cy="btn-delete-campaigns" :disabled="isLoading('campaigns')" @click.prevent="onDeleteSelected(numSelected, selectedQueryParams().toString())">
- {{ Icon "trash-2" }} {{ .L.T "globals.buttons.delete" }} <span x-text="numSelected"></span>
- </button>
- </menu>
- </ot-dropdown>
- </template>
- {{- end }}
-
- <table class="has-select">
- <thead>
- <tr>
- <th width="5%"><input type="checkbox" aria-label="{{ .L.T "globals.buttons.toggleSelect" }}"></th>
- <th width="38%" class="cy-name">{{ $d.Page.SortLink $base "name" (.L.T "globals.fields.name") }}</th>
- <th width="12%" class="cy-type">{{ .L.T "globals.fields.status" }}</th>
- <th width="12%">{{ .L.T "campaigns.stats" }}</th>
- <th width="10%">{{ .L.T "globals.terms.analytics" }}</th>
- <th width="18%" class="cy-timestamp">{{ $d.Page.SortLink $base "created_at" (.L.T "campaigns.timestamps") }}</th>
- <th width="5%" class="align-right"></th>
- </tr>
- </thead>
- <tbody>
- {{- range $d.Campaigns }}
- {{- $canStart := and (eq .Status "draft") (not .SendAt.Valid) -}}
- {{- $canSchedule := and (eq .Status "draft") .SendAt.Valid -}}
- {{- $canPause := eq .Status "running" -}}
- {{- $canResume := eq .Status "paused" -}}
- {{- $canCancel := or (eq .Status "running") (eq .Status "paused") -}}
- {{- $isDone := or (eq .Status "finished") (eq .Status "cancelled") -}}
- {{- $hasEnded := and (or $isDone $canResume) .StartedAt.Valid .UpdatedAt.Valid -}}
- <tr data-campaign-id="{{ .ID }}" class="status-{{ .Status }}">
- <td><input name="id" type="checkbox" value="{{ .ID }}"></td>
- <td class="name">
- <div class="avatar{{ if eq .Status "cancelled" }} disabled{{ end }}">
- {{ template "avatar-icon" dict "Kind" "campaign" "Name" .Name }}
- <div class="avatar-label vstack gap-1">
- <div>
- <a href="{{ $base }}/{{ .ID }}" class="unstyled">{{ .Name }}</a>
- {{- if eq .Type "optin" }}
- <a href="{{ $base }}?type=optin" title="{{ $.L.T "globals.buttons.filter" }} {{ $.L.T "lists.optin" }}">{{ Badge (list (Icon "user-check") ($.L.T "lists.optin")) "small outline" }}</a>
- {{- end }}
- <div class="subject text-8 text-light">
- <a href="{{ $base }}/{{ .ID }}" class="unstyled">{{ .Subject }}</a>
- </div>
- </div>
- {{- if .Tags }}
- <div class="hstack gap-2 text-8">
- {{ range .Tags }}<a href="?{{ $d.Page.Encode "tag" }}&tag={{ . }}" title="{{ $.L.T "globals.buttons.filter" }} {{ . }}" class="tag">#{{ . }}</a>{{ end }}
- </div>
- {{- end }}
- {{- if .ParsedLists }}
- <div class="hstack lists">
- {{- range $i, $l := .ParsedLists }}
- {{- if lt $i 3 }}
- <div class="avatar xsmall">
- {{ template "avatar-icon" dict "Kind" "list" "Name" .Name "Href" (printf "%s/%d" (URI "/admin/lists") .ID) "Title" (printf "%s %s" ($.L.T "globals.buttons.view") .Name) }}
- <a class="unstyled text-light avatar-label" href="{{ URI "/admin/subscribers/lists" }}/{{ .ID }}" title="{{ $.L.T "globals.buttons.filter" }} {{ .Name }}">{{ .Name }}</a>
- </div>
- {{- end }}
- {{- end }}
- {{- if gt (len .ParsedLists) 3 }}
- <ot-dropdown>
- <button type="button" class="ghost small text-8" popovertarget="camp-lists-{{ .ID }}" aria-label="{{ $.L.T "globals.terms.lists" }}">+{{ sub (len .ParsedLists) 3 }} {{ $.L.T "globals.terms.lists" | lower }}</button>
- <menu popover id="camp-lists-{{ .ID }}">
- {{- range slice .ParsedLists 3 }}
- <a role="menuitem" class="button ghost" href="{{ URI "/admin/subscribers/lists" }}/{{ .ID }}" title="{{ $.L.T "globals.buttons.filter" }} {{ .Name }}">
- <span class="avatar xsmall">
- {{ template "avatar-icon" dict "Kind" "list" "Name" .Name }}
- <span class="avatar-label text-light">{{ .Name }}</span>
- </span>
- </a>
- {{- end }}
- </menu>
- </ot-dropdown>
- {{- end }}
- </div>
- {{- end }}
- </div>
- </div>
- </td>
- <td class="type">
- <div class="vstack gap-1">
- <a href="{{ $base }}?status={{ .Status }}" title="{{ $.L.T "globals.buttons.filter" }} {{ $.L.T (printf "campaigns.status.%s" .Status) }}">
- {{ Badge (list (Dot) ($.L.T (printf "campaigns.status.%s" .Status))) (printf "enum status-%s" .Status) }}
- {{- if eq .Status "running" }}<span class="spinner" data-spinner="small" aria-busy="true"></span>{{ end }}
- </a>
- {{- if and (eq .Status "scheduled") .SendAt.Valid }}
- <span class="text-8 text-light" title="{{ ExactDate .SendAt }}">{{ Icon "clock" }} {{ CompactDate .SendAt true true }}</span>
- {{- end }}
- </div>
- </td>
- <td class="stats" data-label="{{ $.L.T "campaigns.stats" }}">
- <div class="vstack gap-1">
- <div><div data-sent-count{{ if eq .Sent 0 }} hidden{{ end }}><span data-stat="sent">{{ FormatNumber .Sent }}</span>{{ if and .ToSend (not (eq .Status "finished")) }} / <span data-stat="to_send">{{ FormatNumber .ToSend }}</span>{{ end }}</div><span class="text-8 text-light"><span data-stat="percent">{{ if .ToSend }}{{ div (mul .Sent 100) .ToSend }}{{ else }}0{{ end }}%</span> {{ $.L.T "campaigns.sent" | lower }}{{ with Duration .StartedAt .UpdatedAt }} · {{ . }}{{ end }}</span></div>
- <div><a class="unstyled" href="{{ URI "/admin/subscribers/bounces" }}?campaign_id={{ .ID }}">{{ FormatNumber .Bounces }} <span class="text-8 text-light">{{ $.L.T "globals.terms.bounces" | lower }}</span></a></div>
- {{- if eq .Status "running" }}
- <div class="hstack gap-1 text-8 campaign-progress">
- <progress data-stat="progress" value="{{ .Sent }}" max="{{ max .ToSend 1 }}" aria-label="{{ $.L.T "campaigns.progress" }}"></progress>
- <span><span data-stat="rate">0</span> <span class="text-light">/ {{ $.L.T "campaigns.rateMinuteShort" }}</span></span>
- </div>
- {{- end }}
- </div>
- </td>
- <td class="stats analytics" data-label="{{ $.L.T "globals.terms.analytics" }}">
- <div class="vstack gap-1">
- <div>{{ FormatNumber .Views }} <span class="text-8 text-light">{{ $.L.T "campaigns.views" | lower }}</span></div>
- <div>{{ FormatNumber .Clicks }} <span class="text-8 text-light">{{ $.L.T "campaigns.clicks" | lower }}</span></div>
- </div>
- </td>
- <td class="timestamp" data-label="{{ $.L.T "campaigns.timestamps" }}">
- {{- $timeline := printf "%s: %s" ($.L.T "globals.fields.createdAt") (ExactDate .CreatedAt) }}
- {{- if .SendAt.Valid }}{{ $timeline = printf "%s\n%s: %s" $timeline ($.L.T "campaigns.status.scheduled") (ExactDate .SendAt) }}{{ end }}
- {{- if .StartedAt.Valid }}{{ $timeline = printf "%s\n%s: %s" $timeline ($.L.T "campaigns.startedAt") (ExactDate .StartedAt) }}{{ end }}
- {{- if $hasEnded }}
- {{- $timeline = printf "%s\n%s: %s" $timeline ($.L.T "campaigns.ended") (ExactDate .UpdatedAt) }}
- {{- end }}
- {{- with Duration .StartedAt .UpdatedAt }}{{ $timeline = printf "%s\n%s: %s" $timeline ($.L.T "settings.performance.slidingWindowDuration") . }}{{ end }}
- <span tabindex="0" title="{{ $timeline }}" @click="$el.focus()" data-tooltip-placement="bottom">
- {{- if $hasEnded }}
- {{ FormatTimestamps .StartedAt .UpdatedAt }}
- {{- else if and (not (or (eq .Status "draft") (eq .Status "scheduled"))) .StartedAt.Valid }}
- {{ CompactDate .StartedAt true }} <span class="text-8 text-light">{{ $.L.T "campaigns.startedAt" | lower }}</span>
- {{- else }}
- {{ NiceDate .CreatedAt }}
- {{- end }}
- </span>
- </td>
- <td class="actions align-right">
- <ot-dropdown>
- <button popovertarget="camp-actions-{{ .ID }}" type="button" class="ghost more icon" aria-label="{{ $.L.T "globals.buttons.more" }}">
- {{ Icon "more-vertical" }}
- </button>
- <menu popover id="camp-actions-{{ .ID }}">
- <button type="button" role="menuitem" class="ghost" data-cy="btn-preview" @click.prevent="onPreview({{ .ID }}, {{ ToJSON .Name }})">{{ Icon "eye" }} {{ $.L.T "campaigns.preview" }}</button>
- {{- if and ($d.Can "campaigns:send") $canStart }}
- <button type="button" role="menuitem" class="ghost" data-cy="btn-start" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'running')">{{ Icon "send" }} {{ $.L.T "campaigns.start" }}</button>
- {{- end }}
- {{- if $d.Can "campaigns:send" }}
- {{- if $canSchedule }}
- <button type="button" role="menuitem" class="ghost" data-cy="btn-schedule" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'scheduled', true)">{{ Icon "clock" }} {{ $.L.T "campaigns.schedule" }}</button>
- {{- end }}
- {{- if $canPause }}
- <button type="button" role="menuitem" class="ghost" data-cy="btn-pause" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'paused')">{{ Icon "pause" }} {{ $.L.T "campaigns.pause" }}</button>
- {{- end }}
- {{- if $canResume }}
- <button type="button" role="menuitem" class="ghost" data-cy="btn-resume" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'running')">{{ Icon "send" }} {{ $.L.T "campaigns.send" }}</button>
- {{- end }}
- {{- if $canCancel }}
- <button type="button" role="menuitem" class="ghost" data-variant="danger" data-cy="btn-cancel" @click.prevent="onChangeStatus({{ .ID }}, {{ ToJSON .Name }}, 'cancelled')">{{ Icon "x-circle" }} {{ $.L.T "globals.buttons.cancel" }}</button>
- {{- end }}
- {{- end }}
- <hr />
- <a href="{{ $base }}/{{ .ID }}" role="menuitem" class="button ghost" data-cy="btn-edit">{{ Icon "edit-2" }} {{ $.L.T "globals.buttons.edit" }}</a>
- {{- if $d.Can "campaigns:manage" "campaigns:manage_all" }}
- <button type="button" role="menuitem" class="ghost" data-cy="btn-clone" @click.prevent="onClone({{ .ID }}, {{ ToJSON .Name }})">{{ Icon "copy" }} {{ $.L.T "globals.buttons.clone" }}</button>
- {{- end }}
- {{- if $d.Can "campaigns:get_analytics" }}
- <a href="{{ URI "/admin/campaigns/analytics" }}?id={{ .ID }}" role="menuitem" class="button ghost" data-cy="btn-analytics">{{ Icon "bar-chart-2" }} {{ $.L.T "globals.terms.analytics" }}</a>
- {{- end }}
- {{- if $d.Can "campaigns:manage" "campaigns:manage_all" }}
- <hr />
- <button type="button" role="menuitem" class="ghost" data-variant="danger" data-cy="btn-delete" :disabled="isLoading('campaigns')" @click.prevent="onDelete({{ .ID }}, {{ ToJSON .Name }})">{{ Icon "trash-2" }} {{ $.L.T "globals.buttons.delete" }}</button>
- {{- end }}
- </menu>
- </ot-dropdown>
- </td>
- </tr>
- {{- else }}
- {{ template "empty-state" 7 }}
- {{- end }}
- </tbody>
- </table>
-
- {{- template "pagination" $d.Page.Pagination }}
- </div>
+ {{ template "campaigns-table" dict "Root" . "Base" $base "Readonly" false }}
</div>
{{ template "campaign-preview" . }}
diff --git a/static/admin/views/list.html b/static/admin/views/list.html
index a0ac9187..a6ca2d19 100644
--- a/static/admin/views/list.html
+++ b/static/admin/views/list.html
@@ -8,7 +8,7 @@
<script>const _form = {{ if $d.IsNew }}null{{ else }}{{ ToJSON $d.List }}{{ end }};</script>
<section class="lists" x-data="listsView(_form)">
<header class="page-header">
- <div class="hstack gap-1">
+ <div class="hstack gap-3">
<div class="avatar avatar-title{{ if eq $d.List.Status "archived" }} disabled{{ end }}">
{{ if not $d.IsNew }}{{ template "avatar-icon" dict "Kind" "list" "Name" $d.List.Name }}{{ end }}
<h1 class="page-title avatar-label">{{ if $d.IsNew }}{{ .L.T "lists.newList" }}{{ else }}{{ $d.List.Name }}{{ end }}</h1>
@@ -19,11 +19,24 @@
{{ if $d.IsNew }}
{{ template "list-form" dict "Root" . "Submit" "onSubmitNew" "IsNew" true "CanSave" ($d.Can "lists:manage_all") }}
{{ else }}
- {{ template "list-form" dict "Root" . "Submit" "onSubmitUpdate" "CanSave" ($d.CanManageList $d.List.ID) }}
+ {{- $base := printf "%s/%d" (URI "/admin/lists") $d.List.ID -}}
+ <div role="tablist" data-variant="primary">
+ <a role="tab" href="{{ $base }}" {{ if eq $d.Tab "list" }}aria-selected="true"{{ end }}>{{ Icon "list" }} {{ .L.T "globals.buttons.view" }}</a>
+ <a role="tab" href="{{ $base }}/edit" {{ if eq $d.Tab "edit" }}aria-selected="true"{{ end }}>{{ Icon "edit-2" }} {{ .L.T "globals.buttons.edit" }}</a>
+ </div>
+ {{ if eq $d.Tab "edit" }}
+ {{ template "list-form" dict "Root" . "Submit" "onSubmitUpdate" "CanSave" ($d.CanManageList $d.List.ID) }}
+ {{ else }}
+ {{ template "list-info" . }}
+ {{ end }}
{{ end }}
</section>
<script type="module" src="{{ URI "/admin/static/js/views/lists.js" }}?v={{ .AssetVersion }}" defer></script>
+{{ if and (eq $d.Tab "list") ($d.Can "campaigns:get" "campaigns:get_all") }}
+<script type="module" src="{{ URI "/admin/static/js/views/campaigns.js" }}?v={{ .AssetVersion }}" defer></script>
+{{ end }}
+
{{ template "admin-footer" . -}}
{{ end }}
diff --git a/static/admin/views/lists.html b/static/admin/views/lists.html
index a88e9bcb..ae4aae63 100644
--- a/static/admin/views/lists.html
+++ b/static/admin/views/lists.html
@@ -80,12 +80,12 @@
{{- range $d.Lists }}
<tr class="list-main-row" data-testid="list-row" data-id="{{ .ID }}">
<td><input name="id" type="checkbox" value="{{ .ID }}"></td>
- <td>
+ <td class="list-name">
<div class="avatar{{ if eq .Status "archived" }} disabled{{ end }}">
{{ template "avatar-icon" dict "Kind" "list" "Name" .Name }}
<div class="avatar-label">
<a href="{{ URI "/admin/lists" }}/{{ .ID }}" class="unstyled">{{ .Name }}</a>
- {{- if .Description }}<div class="text-light text-8">{{ .Description }}</div>{{ end }}
+ {{- if .Description }}<div class="description text-light text-8" title="{{ .Description }}">{{ .Description }}</div>{{ end }}
<div class="hstack gap-2 text-8">
{{ range .Tags }}<a href="?{{ $d.Page.Encode "tag" }}&tag={{ . }}" title="{{ $.L.T "globals.buttons.filter" }} {{ . }}">#{{ . }}</a>{{ end }}
</div>
@@ -139,14 +139,17 @@
<!-- <p class="text-lighter text-8">{{ NiceDate .UpdatedAt }}</p> -->
</td>
<td class="actions align-right">
- {{- if or ($d.Can "campaigns:manage" "campaigns:manage_all") ($d.CanManageList .ID) ($d.Can "subscribers:import") }}
<ot-dropdown>
<button popovertarget="list-actions-{{ .ID }}" type="button" class="ghost more icon" aria-label="{{ $.L.T "globals.buttons.more" }}">
{{ Icon "more-vertical" }}
</button>
<menu popover id="list-actions-{{ .ID }}">
+ <a href="{{ URI "/admin/lists" }}/{{ .ID }}" role="menuitem" class="button ghost" data-testid="btn-view">{{ Icon "eye" }} {{ $.L.T "globals.buttons.view" }}</a>
+ {{- if or ($d.Can "campaigns:manage" "campaigns:manage_all") ($d.CanManageList .ID) ($d.Can "subscribers:import") }}
+ <hr />
+ {{- end }}
{{- if $d.CanManageList .ID }}
- <a href="{{ URI "/admin/lists" }}/{{ .ID }}" role="menuitem" class="button ghost" data-testid="btn-edit">{{ Icon "edit-2" }} {{ $.L.T "globals.buttons.edit" }}</a>
+ <a href="{{ URI "/admin/lists" }}/{{ .ID }}/edit" role="menuitem" class="button ghost" data-testid="btn-edit">{{ Icon "edit-2" }} {{ $.L.T "globals.buttons.edit" }}</a>
{{- end }}
{{- if $d.Can "subscribers:import" }}
<a href="{{ URI "/admin/import" }}?list_id={{ .ID }}" role="menuitem" class="button ghost" data-testid="btn-import">{{ Icon "upload" }} {{ $.L.T "globals.terms.import" }}</a>
@@ -154,7 +157,7 @@
{{- if $d.CanManageList .ID }}
<button type="button" role="menuitem" class="ghost" data-variant="danger" data-testid="btn-delete" :disabled="isLoading('lists')" @click.prevent="onDeleteList({{ .ID }}, {{ ToJSON .Name }})">{{ Icon "trash-2" }} {{ $.L.T "globals.buttons.delete" }}</button>
{{- end }}
- <hr />
+ {{- if and ($d.Can "campaigns:manage" "campaigns:manage_all") (or ($d.CanManageList .ID) ($d.Can "subscribers:import")) }}<hr />{{ end }}
{{- if $d.Can "campaigns:manage" "campaigns:manage_all" }}
<a href="{{ URI "/admin/campaigns/new" }}?list_id={{ .ID }}" role="menuitem" class="button ghost" data-testid="btn-campaign">{{ Icon "send" }} {{ $.L.T "campaigns.newCampaign" }}</a>
{{- end }}
@@ -165,7 +168,6 @@
{{- end }}
</menu>
</ot-dropdown>
- {{- end }}
</td>
</tr>
{{- else }}