High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
JavaScript campaigncampaign-managementemail-marketingemail-subscriptionlistmonkmailing-listnewsletternewsletter-managementnewsletter-softwareself-hostedsms-gatewaysmtptransactional-emails
Move static assets to 'static' dir
Kailash Nadh709668d811c8
diff --git a/init.go b/init.goindex 769a5791..699f30c4 100644--- a/init.go+++ b/init.go@@ -50,8 +50,10 @@ func initFS() stuffbin.FileSystem {"config.toml.sample","queries.sql","schema.sql",- "email-templates",- "public",+ "static/email-templates",++ // Alias /static/public to /public for the HTTP fileserver.+ "static/public:/public",// The frontend app's static assets are aliased to /frontend// so that they are accessible at localhost:port/frontend/static/ ...@@ -261,7 +263,7 @@ func initNotifTemplates(path string, fs stuffbin.FileSystem, cs *constants) *temreturn cs.LogoURL}}- tpl, err := stuffbin.ParseTemplatesGlob(funcs, fs, "/email-templates/*.html")+ tpl, err := stuffbin.ParseTemplatesGlob(funcs, fs, "/static/email-templates/*.html")if err != nil {lo.Fatalf("error parsing e-mail notif templates: %v", err)}diff --git a/email-templates/base.html b/static/email-templates/base.htmlsimilarity index 100%rename from email-templates/base.htmlrename to static/email-templates/base.htmldiff --git a/email-templates/campaign-status.html b/static/email-templates/campaign-status.htmlsimilarity index 100%rename from email-templates/campaign-status.htmlrename to static/email-templates/campaign-status.htmldiff --git a/email-templates/default.tpl b/static/email-templates/default.tplsimilarity index 100%rename from email-templates/default.tplrename to static/email-templates/default.tpldiff --git a/email-templates/import-status.html b/static/email-templates/import-status.htmlsimilarity index 100%rename from email-templates/import-status.htmlrename to static/email-templates/import-status.htmldiff --git a/email-templates/subscriber-data.html b/static/email-templates/subscriber-data.htmlsimilarity index 100%rename from email-templates/subscriber-data.htmlrename to static/email-templates/subscriber-data.htmldiff --git a/email-templates/subscriber-optin-campaign.html b/static/email-templates/subscriber-optin-campaign.htmlsimilarity index 100%rename from email-templates/subscriber-optin-campaign.htmlrename to static/email-templates/subscriber-optin-campaign.htmldiff --git a/email-templates/subscriber-optin.html b/static/email-templates/subscriber-optin.htmlsimilarity index 100%rename from email-templates/subscriber-optin.htmlrename to static/email-templates/subscriber-optin.htmldiff --git a/static/public/base.html b/static/public/base.htmlnew file mode 100644index 00000000..0f478973--- /dev/null+++ b/static/public/base.html@@ -0,0 +1,98 @@+{{ define "header" }}+<!doctype html>+<html>+ <head>+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />+ <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />+ <base target="_blank">++ <style>+ body {+ background-color: #F0F1F3;+ font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;+ font-size: 15px;+ line-height: 26px;+ margin: 0;+ color: #444;+ }++ .wrap {+ background-color: #fff;+ padding: 30px;+ max-width: 525px;+ margin: 0 auto;+ border-radius: 5px;+ }++ .header {+ border-bottom: 1px solid #eee;+ padding-bottom: 15px;+ margin-bottom: 15px;+ }++ .footer {+ text-align: center;+ font-size: 12px;+ color: #888;+ }+ .footer a {+ color: #888;+ }++ .gutter {+ padding: 30px;+ }+ .button {+ background: #7f2aff;+ color: #fff !important;+ display: inline-block;+ border-radius: 3px;+ padding: 10px 30px;+ text-align: center;+ text-decoration: none;+ font-weight: bold;+ }+ .button:hover {+ background: #222;+ color: #fff;+ }+ img {+ max-width: 100%;+ }++ a {+ color: #7f2aff;+ }+ a:hover {+ color: #111;+ }+ @media screen and (max-width: 600px) {+ .wrap {+ max-width: auto;+ }+ .gutter {+ padding: 10px;+ }+ }+ </style>+ </head>+<body style="background-color: #F0F1F3;">+ <div class="gutter"> </div>+ <div class="wrap">+ <div class="header">+ {{ if ne LogoURL "" }}+ <a href="{{ RootURL }}"><img src="{{ LogoURL }}" alt="listmonk" /></a>+ {{ end }}+ </div>+{{ end }}++{{ define "footer" }}+ </div>++ <div class="footer">+ <p>Powered by <a href="https://listmonk.app" target="_blank">listmonk</a></p>+ </div>+ <div class="gutter"> </div>+</body>+</html>+{{ end }}diff --git a/static/public/campaign-status.html b/static/public/campaign-status.htmlnew file mode 100644index 00000000..d174c02b--- /dev/null+++ b/static/public/campaign-status.html@@ -0,0 +1,25 @@+{{ define "campaign-status" }}+{{ template "header" . }}+<h2>Campaign update</h2>+<table width="100%">+ <tr>+ <td width="30%"><strong>Campaign</strong></td>+ <td><a href="{{ index . "RootURL" }}/campaigns/{{ index . "ID" }}">{{ index . "Name" }}</a></td>+ </tr>+ <tr>+ <td width="30%"><strong>Status</strong></td>+ <td>{{ index . "Status" }}</td>+ </tr>+ <tr>+ <td width="30%"><strong>Sent</strong></td>+ <td>{{ index . "Sent" }} / {{ index . "ToSend" }}</td>+ </tr>+ {{ if ne (index . "Reason") "" }}+ <tr>+ <td width="30%"><strong>Reason</strong></td>+ <td>{{ index . "Reason" }}</td>+ </tr>+ {{ end }}+</table>+{{ template "footer" }}+{{ end }}\ No newline at end of filediff --git a/static/public/default.tpl b/static/public/default.tplnew file mode 100644index 00000000..810a42b8--- /dev/null+++ b/static/public/default.tpl@@ -0,0 +1,84 @@+<!doctype html>+<html>+ <head>+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8">+ <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">+ <base target="_blank">++ <style>+ body {+ background-color: #F0F1F3;+ font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;+ font-size: 15px;+ line-height: 26px;+ margin: 0;+ color: #444;+ }++ .wrap {+ background-color: #fff;+ padding: 30px;+ max-width: 525px;+ margin: 0 auto;+ border-radius: 5px;+ }++ .button {+ background: #7f2aff;+ border-radius: 3px;+ text-decoration: none !important;+ color: #fff !important;+ font-weight: bold;+ padding: 10px 30px;+ display: inline-block;+ }+ .button:hover {+ background: #111;+ }++ .footer {+ text-align: center;+ font-size: 12px;+ color: #888;+ }+ .footer a {+ color: #888;+ }++ .gutter {+ padding: 30px;+ }++ img {+ max-width: 100%;+ }++ a {+ color: #7f2aff;+ }+ a:hover {+ color: #111;+ }+ @media screen and (max-width: 600px) {+ .wrap {+ max-width: auto;+ }+ .gutter {+ padding: 10px;+ }+ }+ </style>+ </head>+<body style="background-color: #F0F1F3;font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;font-size: 15px;line-height: 26px;margin: 0;color: #444;">+ <div class="gutter" style="padding: 30px;"> </div>+ <div class="wrap" style="background-color: #fff;padding: 30px;max-width: 525px;margin: 0 auto;border-radius: 5px;">+ {{ template "content" . }}+ </div>++ <div class="footer" style="text-align: center;font-size: 12px;color: #888;">+ <p>Don't want to receive these e-mails? <a href="{{ UnsubscribeURL }}" style="color: #888;">Unsubscribe</a></p>+ <p>Powered by <a href="https://listmonk.app" target="_blank" style="color: #888;">listmonk</a></p>+ </div>+ <div class="gutter" style="padding: 30px;"> {{ TrackView }}</div>+</body>+</html>diff --git a/static/public/import-status.html b/static/public/import-status.htmlnew file mode 100644index 00000000..3fa6e08e--- /dev/null+++ b/static/public/import-status.html@@ -0,0 +1,19 @@+{{ define "import-status" }}+{{ template "header" . }}+<h2>Import update</h2>+<table width="100%">+ <tr>+ <td width="30%"><strong>File</strong></td>+ <td><a href="{{ RootURL }}/subscribers/import">{{ .Name }}</a></td>+ </tr>+ <tr>+ <td width="30%"><strong>Status</strong></td>+ <td>{{ .Status }}</td>+ </tr>+ <tr>+ <td width="30%"><strong>Records</strong></td>+ <td>{{ .Imported }} / {{ .Total }}</td>+ </tr>+</table>+{{ template "footer" }}+{{ end }}\ No newline at end of filediff --git a/public/static/logo.png b/static/public/static/logo.pngsimilarity index 100%rename from public/static/logo.pngrename to static/public/static/logo.pngdiff --git a/public/static/logo.svg b/static/public/static/logo.svgsimilarity index 100%rename from public/static/logo.svgrename to static/public/static/logo.svgdiff --git a/public/static/script.js b/static/public/static/script.jssimilarity index 100%rename from public/static/script.jsrename to static/public/static/script.jsdiff --git a/public/static/style.css b/static/public/static/style.csssimilarity index 100%rename from public/static/style.cssrename to static/public/static/style.cssdiff --git a/static/public/subscriber-data.html b/static/public/subscriber-data.htmlnew file mode 100644index 00000000..3873abad--- /dev/null+++ b/static/public/subscriber-data.html@@ -0,0 +1,9 @@+{{ define "subscriber-data" }}+{{ template "header" . }}+<h2>Your data</h2>+<p>+ A copy of all data recorded on you is attached as a file in the JSON format.+ It can be viewed in a text editor.+</p>+{{ template "footer" }}+{{ end }}diff --git a/static/public/subscriber-optin-campaign.html b/static/public/subscriber-optin-campaign.htmlnew file mode 100644index 00000000..fbdaab6d--- /dev/null+++ b/static/public/subscriber-optin-campaign.html@@ -0,0 +1,17 @@+{{ define "optin-campaign" }}++<p>Hi {{`{{ .Subscriber.FirstName }}`}},</p>+<p>You have been added to the following mailing lists:</p>+<ul>+ {{ range $i, $l := .Lists }}+ {{ if eq .Type "public" }}+ <li>{{ .Name }}</li>+ {{ else }}+ <li>Private list</li>+ {{ end }}+ {{ end }}+</ul>+<p>+ <a class="button" {{ .OptinURLAttr }} class="button">Confirm subscription(s)</a>+</p>+{{ end }}diff --git a/static/public/subscriber-optin.html b/static/public/subscriber-optin.htmlnew file mode 100644index 00000000..f81bff37--- /dev/null+++ b/static/public/subscriber-optin.html@@ -0,0 +1,21 @@+{{ define "subscriber-optin" }}+{{ template "header" . }}+<h2>Confirm subscription</h2>+<p>Hi {{ .Subscriber.FirstName }},</p>+<p>You have been added to the following mailing lists:</p>+<ul>+ {{ range $i, $l := .Lists }}+ {{ if eq .Type "public" }}+ <li>{{ .Name }}</li>+ {{ else }}+ <li>Private list</li>+ {{ end }}+ {{ end }}+</ul>+<p>Confirm your subscription by clicking the below button.</p>+<p>+ <a href="{{ .OptinURL }}" class="button">Confirm subscription</a>+</p>++{{ template "footer" }}+{{ end }}diff --git a/public/templates/index.html b/static/public/templates/index.htmlsimilarity index 100%rename from public/templates/index.htmlrename to static/public/templates/index.htmldiff --git a/public/templates/message.html b/static/public/templates/message.htmlsimilarity index 100%rename from public/templates/message.htmlrename to static/public/templates/message.htmldiff --git a/public/templates/optin.html b/static/public/templates/optin.htmlsimilarity index 100%rename from public/templates/optin.htmlrename to static/public/templates/optin.htmldiff --git a/public/templates/subscription.html b/static/public/templates/subscription.htmlsimilarity index 100%rename from public/templates/subscription.htmlrename to static/public/templates/subscription.html