Skip to content

Commit 709668d

Browse files
committed
Move static assets to 'static' dir
1 parent 9005bb6 commit 709668d

23 files changed

+278
-3
lines changed

init.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,10 @@ func initFS() stuffbin.FileSystem {
5050
"config.toml.sample",
5151
"queries.sql",
5252
"schema.sql",
53-
"email-templates",
54-
"public",
53+
"static/email-templates",
54+
55+
// Alias /static/public to /public for the HTTP fileserver.
56+
"static/public:/public",
5557

5658
// The frontend app's static assets are aliased to /frontend
5759
// so that they are accessible at localhost:port/frontend/static/ ...
@@ -261,7 +263,7 @@ func initNotifTemplates(path string, fs stuffbin.FileSystem, cs *constants) *tem
261263
return cs.LogoURL
262264
}}
263265

264-
tpl, err := stuffbin.ParseTemplatesGlob(funcs, fs, "/email-templates/*.html")
266+
tpl, err := stuffbin.ParseTemplatesGlob(funcs, fs, "/static/email-templates/*.html")
265267
if err != nil {
266268
lo.Fatalf("error parsing e-mail notif templates: %v", err)
267269
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

static/public/base.html

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
{{ define "header" }}
2+
<!doctype html>
3+
<html>
4+
<head>
5+
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
7+
<base target="_blank">
8+
9+
<style>
10+
body {
11+
background-color: #F0F1F3;
12+
font-family: 'Helvetica Neue', 'Segoe UI', Helvetica, sans-serif;
13+
font-size: 15px;
14+
line-height: 26px;
15+
margin: 0;
16+
color: #444;
17+
}
18+
19+
.wrap {
20+
background-color: #fff;
21+
padding: 30px;
22+
max-width: 525px;
23+
margin: 0 auto;
24+
border-radius: 5px;
25+
}
26+
27+
.header {
28+
border-bottom: 1px solid #eee;
29+
padding-bottom: 15px;
30+
margin-bottom: 15px;
31+
}
32+
33+
.footer {
34+
text-align: center;
35+
font-size: 12px;
36+
color: #888;
37+
}
38+
.footer a {
39+
color: #888;
40+
}
41+
42+
.gutter {
43+
padding: 30px;
44+
}
45+
.button {
46+
background: #7f2aff;
47+
color: #fff !important;
48+
display: inline-block;
49+
border-radius: 3px;
50+
padding: 10px 30px;
51+
text-align: center;
52+
text-decoration: none;
53+
font-weight: bold;
54+
}
55+
.button:hover {
56+
background: #222;
57+
color: #fff;
58+
}
59+
img {
60+
max-width: 100%;
61+
}
62+
63+
a {
64+
color: #7f2aff;
65+
}
66+
a:hover {
67+
color: #111;
68+
}
69+
@media screen and (max-width: 600px) {
70+
.wrap {
71+
max-width: auto;
72+
}
73+
.gutter {
74+
padding: 10px;
75+
}
76+
}
77+
</style>
78+
</head>
79+
<body style="background-color: #F0F1F3;">
80+
<div class="gutter">&nbsp;</div>
81+
<div class="wrap">
82+
<div class="header">
83+
{{ if ne LogoURL "" }}
84+
<a href="{{ RootURL }}"><img src="{{ LogoURL }}" alt="listmonk" /></a>
85+
{{ end }}
86+
</div>
87+
{{ end }}
88+
89+
{{ define "footer" }}
90+
</div>
91+
92+
<div class="footer">
93+
<p>Powered by <a href="https://listmonk.app" target="_blank">listmonk</a></p>
94+
</div>
95+
<div class="gutter">&nbsp;</div>
96+
</body>
97+
</html>
98+
{{ end }}

static/public/campaign-status.html

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
{{ define "campaign-status" }}
2+
{{ template "header" . }}
3+
<h2>Campaign update</h2>
4+
<table width="100%">
5+
<tr>
6+
<td width="30%"><strong>Campaign</strong></td>
7+
<td><a href="{{ index . "RootURL" }}/campaigns/{{ index . "ID" }}">{{ index . "Name" }}</a></td>
8+
</tr>
9+
<tr>
10+
<td width="30%"><strong>Status</strong></td>
11+
<td>{{ index . "Status" }}</td>
12+
</tr>
13+
<tr>
14+
<td width="30%"><strong>Sent</strong></td>
15+
<td>{{ index . "Sent" }} / {{ index . "ToSend" }}</td>
16+
</tr>
17+
{{ if ne (index . "Reason") "" }}
18+
<tr>
19+
<td width="30%"><strong>Reason</strong></td>
20+
<td>{{ index . "Reason" }}</td>
21+
</tr>
22+
{{ end }}
23+
</table>
24+
{{ template "footer" }}
25+
{{ end }}

0 commit comments

Comments
 (0)