Skip to content

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

Refactor all public admin pages (login/reset etc.) to use new admin UI styles.

Kailash Nadhde0e28183dcd
diff --git a/cmd/public.go b/cmd/public.go
index b54e87c3..ff6df366 100644
--- a/cmd/public.go
+++ b/cmd/public.go
@@ -144,6 +144,11 @@ var (
// Render executes and renders a template for echo.
func (t *pubTplRenderer) Render(c *echo.Context, w io.Writer, name string, data any) error {
+ // Auth confirmations and errors use the public admin layout.
+ if name == tplMessage && (strings.HasPrefix(c.Path(), "/admin/") || strings.HasPrefix(c.Path(), "/auth/")) {
+ name = "admin-public-message"
+ }
+
return t.templates.ExecuteTemplate(w, name, tplData{
SiteName: t.SiteName,
RootURL: t.RootURL,
diff --git a/static/admin/assets/css/style.css b/static/admin/assets/css/style.css
index c641f24a..818acfa5 100644
--- a/static/admin/assets/css/style.css
+++ b/static/admin/assets/css/style.css
@@ -97,15 +97,12 @@
html,
body {
height: 100%;
-}
-
-html,
-body {
background: var(--body);
}
body {
font-family: var(--font-sans);
+ min-width: 320px;
}
a {
@@ -1870,6 +1867,28 @@ section.users {
}
}
+/* Public admin pages */
+body.admin-public {
+ height: auto;
+ padding: 60px 16px 30px;
+
+ .page-title {
+ margin-bottom: var(--space-6);
+ }
+
+ .public-container {
+ width: 100%;
+ max-width: 450px;
+ margin: 0 auto;
+ }
+
+ .auth-logo img {
+ width: auto;
+ max-height: 24px;
+ }
+}
+
+
/* Responsive */
@media (max-width: 769px) {
main > .container {
diff --git a/static/admin/assets/static/logo.svg b/static/admin/assets/static/logo.svg
index d3d36e75..c286998c 100644
--- a/static/admin/assets/static/logo.svg
+++ b/static/admin/assets/static/logo.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="163.03" height="30.38" viewBox="0 0 43.135 8.038" xmlns:v="https://vecta.io/nano"><circle cx="4.019" cy="4.019" r="3.149" fill="none" stroke="#0055d4" stroke-width="1.74"/><path d="M11.457 7.303q-.566 0-.879-.322-.313-.331-.313-.932V.712L11.5.572v5.442q0 .305.253.305.139 0 .244-.052l.253.879q-.357.157-.792.157zm2.619-4.754v4.615H12.84V2.549zM13.449.172q.331 0 .54.209.218.2.218.514 0 .313-.218.522-.209.2-.54.2-.331 0-.54-.2-.209-.209-.209-.522 0-.313.209-.514.209-.209.54-.209zm3.319 2.238q.975 0 1.672.557l-.47.705q-.583-.366-1.149-.366-.305 0-.47.113-.165.113-.165.305 0 .139.07.235.078.096.279.183.209.087.618.209.731.2 1.088.54.357.331.357.914 0 .462-.27.801-.261.34-.714.522-.453.174-1.01.174-.583 0-1.062-.174-.479-.183-.819-.496l.61-.679q.583.453 1.237.453.348 0 .549-.131.209-.139.209-.374 0-.183-.078-.287-.078-.104-.287-.192-.209-.096-.653-.218-.697-.192-1.036-.54-.331-.357-.331-.879 0-.392.226-.705.226-.313.636-.488.418-.183.967-.183zm5.342 4.536q-.253.174-.575.261-.313.096-.627.096-.714-.009-1.08-.409-.366-.401-.366-1.176V3.42h-.688v-.871h.688v-1.01l1.237-.148v1.158h1.062l-.122.871h-.94v2.273q0 .331.113.479.113.148.348.148.235 0 .522-.157zm5.493-4.536q.549 0 .879.374.34.374.34 1.019v3.361h-1.237V4.012q0-.679-.453-.679-.244 0-.427.157-.183.157-.374.488v3.187h-1.237V4.012q0-.679-.453-.679-.244 0-.427.165-.183.157-.366.479v3.187h-1.237V2.549h1.071l.096.575q.261-.348.583-.531.331-.183.758-.183.392 0 .679.2.287.192.418.549.287-.374.618-.557.34-.192.766-.192zm4.148 0q1.036 0 1.62.653.583.644.583 1.794 0 .731-.27 1.289-.261.549-.766.853-.496.305-1.176.305-1.036 0-1.628-.644-.583-.653-.583-1.803 0-.731.261-1.28.27-.557.766-.862.505-.305 1.193-.305zm0 .923q-.47 0-.705.374-.226.366-.226 1.149 0 .784.226 1.158.235.366.697.366.462 0 .688-.366.235-.374.235-1.158 0-.784-.226-1.149-.226-.374-.688-.374zm5.271-.923q.61 0 .949.374.34.366.34 1.019v3.361h-1.237V4.012q0-.374-.131-.522-.122-.157-.374-.157-.261 0-.479.165-.209.157-.409.479v3.187h-1.237V2.549h1.071l.096.583q.287-.357.627-.54.348-.183.784-.183zM40.2.572v6.592h-1.237V.712zm2.804 1.977l-1.472 2.029 1.602 2.586h-1.402l-1.489-2.525 1.48-2.09z"/></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="163.03" height="30.38" viewBox="0 0 43.135 8.038" xmlns:v="https://vecta.io/nano"><style>:root{color:#09090b}@media(prefers-color-scheme:dark){:root{color:#f7f8f8}}</style><circle cx="4.019" cy="4.019" r="3.149" fill="none" stroke="#0055d4" stroke-width="1.74"/><path fill="currentColor" d="M11.457 7.303q-.566 0-.879-.322-.313-.331-.313-.932V.712L11.5.572v5.442q0 .305.253.305.139 0 .244-.052l.253.879q-.357.157-.792.157zm2.619-4.754v4.615H12.84V2.549zM13.449.172q.331 0 .54.209.218.2.218.514 0 .313-.218.522-.209.2-.54.2-.331 0-.54-.2-.209-.209-.209-.522 0-.313.209-.514.209-.209.54-.209zm3.319 2.238q.975 0 1.672.557l-.47.705q-.583-.366-1.149-.366-.305 0-.47.113-.165.113-.165.305 0 .139.07.235.078.096.279.183.209.087.618.209.731.2 1.088.54.357.331.357.914 0 .462-.27.801-.261.34-.714.522-.453.174-1.01.174-.583 0-1.062-.174-.479-.183-.819-.496l.61-.679q.583.453 1.237.453.348 0 .549-.131.209-.139.209-.374 0-.183-.078-.287-.078-.104-.287-.192-.209-.096-.653-.218-.697-.192-1.036-.54-.331-.357-.331-.879 0-.392.226-.705.226-.313.636-.488.418-.183.967-.183zm5.342 4.536q-.253.174-.575.261-.313.096-.627.096-.714-.009-1.08-.409-.366-.401-.366-1.176V3.42h-.688v-.871h.688v-1.01l1.237-.148v1.158h1.062l-.122.871h-.94v2.273q0 .331.113.479.113.148.348.148.235 0 .522-.157zm5.493-4.536q.549 0 .879.374.34.374.34 1.019v3.361h-1.237V4.012q0-.679-.453-.679-.244 0-.427.157-.183.157-.374.488v3.187h-1.237V4.012q0-.679-.453-.679-.244 0-.427.165-.183.157-.366.479v3.187h-1.237V2.549h1.071l.096.575q.261-.348.583-.531.331-.183.758-.183.392 0 .679.2.287.192.418.549.287-.374.618-.557.34-.192.766-.192zm4.148 0q1.036 0 1.62.653.583.644.583 1.794 0 .731-.27 1.289-.261.549-.766.853-.496.305-1.176.305-1.036 0-1.628-.644-.583-.653-.583-1.803 0-.731.261-1.28.27-.557.766-.862.505-.305 1.193-.305zm0 .923q-.47 0-.705.374-.226.366-.226 1.149 0 .784.226 1.158.235.366.697.366.462 0 .688-.366.235-.374.235-1.158 0-.784-.226-1.149-.226-.374-.688-.374zm5.271-.923q.61 0 .949.374.34.366.34 1.019v3.361h-1.237V4.012q0-.374-.131-.522-.122-.157-.374-.157-.261 0-.479.165-.209.157-.409.479v3.187h-1.237V2.549h1.071l.096.583q.287-.357.627-.54.348-.183.784-.183zM40.2.572v6.592h-1.237V.712zm2.804 1.977l-1.472 2.029 1.602 2.586h-1.402l-1.489-2.525 1.48-2.09z"/></svg>
\ No newline at end of file
diff --git a/static/public/static/logo.svg b/static/public/static/logo.svg
index d3d36e75..c286998c 100644
--- a/static/public/static/logo.svg
+++ b/static/public/static/logo.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" width="163.03" height="30.38" viewBox="0 0 43.135 8.038" xmlns:v="https://vecta.io/nano"><circle cx="4.019" cy="4.019" r="3.149" fill="none" stroke="#0055d4" stroke-width="1.74"/><path d="M11.457 7.303q-.566 0-.879-.322-.313-.331-.313-.932V.712L11.5.572v5.442q0 .305.253.305.139 0 .244-.052l.253.879q-.357.157-.792.157zm2.619-4.754v4.615H12.84V2.549zM13.449.172q.331 0 .54.209.218.2.218.514 0 .313-.218.522-.209.2-.54.2-.331 0-.54-.2-.209-.209-.209-.522 0-.313.209-.514.209-.209.54-.209zm3.319 2.238q.975 0 1.672.557l-.47.705q-.583-.366-1.149-.366-.305 0-.47.113-.165.113-.165.305 0 .139.07.235.078.096.279.183.209.087.618.209.731.2 1.088.54.357.331.357.914 0 .462-.27.801-.261.34-.714.522-.453.174-1.01.174-.583 0-1.062-.174-.479-.183-.819-.496l.61-.679q.583.453 1.237.453.348 0 .549-.131.209-.139.209-.374 0-.183-.078-.287-.078-.104-.287-.192-.209-.096-.653-.218-.697-.192-1.036-.54-.331-.357-.331-.879 0-.392.226-.705.226-.313.636-.488.418-.183.967-.183zm5.342 4.536q-.253.174-.575.261-.313.096-.627.096-.714-.009-1.08-.409-.366-.401-.366-1.176V3.42h-.688v-.871h.688v-1.01l1.237-.148v1.158h1.062l-.122.871h-.94v2.273q0 .331.113.479.113.148.348.148.235 0 .522-.157zm5.493-4.536q.549 0 .879.374.34.374.34 1.019v3.361h-1.237V4.012q0-.679-.453-.679-.244 0-.427.157-.183.157-.374.488v3.187h-1.237V4.012q0-.679-.453-.679-.244 0-.427.165-.183.157-.366.479v3.187h-1.237V2.549h1.071l.096.575q.261-.348.583-.531.331-.183.758-.183.392 0 .679.2.287.192.418.549.287-.374.618-.557.34-.192.766-.192zm4.148 0q1.036 0 1.62.653.583.644.583 1.794 0 .731-.27 1.289-.261.549-.766.853-.496.305-1.176.305-1.036 0-1.628-.644-.583-.653-.583-1.803 0-.731.261-1.28.27-.557.766-.862.505-.305 1.193-.305zm0 .923q-.47 0-.705.374-.226.366-.226 1.149 0 .784.226 1.158.235.366.697.366.462 0 .688-.366.235-.374.235-1.158 0-.784-.226-1.149-.226-.374-.688-.374zm5.271-.923q.61 0 .949.374.34.366.34 1.019v3.361h-1.237V4.012q0-.374-.131-.522-.122-.157-.374-.157-.261 0-.479.165-.209.157-.409.479v3.187h-1.237V2.549h1.071l.096.583q.287-.357.627-.54.348-.183.784-.183zM40.2.572v6.592h-1.237V.712zm2.804 1.977l-1.472 2.029 1.602 2.586h-1.402l-1.489-2.525 1.48-2.09z"/></svg>
\ No newline at end of file
+<svg xmlns="http://www.w3.org/2000/svg" width="163.03" height="30.38" viewBox="0 0 43.135 8.038" xmlns:v="https://vecta.io/nano"><style>:root{color:#09090b}@media(prefers-color-scheme:dark){:root{color:#f7f8f8}}</style><circle cx="4.019" cy="4.019" r="3.149" fill="none" stroke="#0055d4" stroke-width="1.74"/><path fill="currentColor" d="M11.457 7.303q-.566 0-.879-.322-.313-.331-.313-.932V.712L11.5.572v5.442q0 .305.253.305.139 0 .244-.052l.253.879q-.357.157-.792.157zm2.619-4.754v4.615H12.84V2.549zM13.449.172q.331 0 .54.209.218.2.218.514 0 .313-.218.522-.209.2-.54.2-.331 0-.54-.2-.209-.209-.209-.522 0-.313.209-.514.209-.209.54-.209zm3.319 2.238q.975 0 1.672.557l-.47.705q-.583-.366-1.149-.366-.305 0-.47.113-.165.113-.165.305 0 .139.07.235.078.096.279.183.209.087.618.209.731.2 1.088.54.357.331.357.914 0 .462-.27.801-.261.34-.714.522-.453.174-1.01.174-.583 0-1.062-.174-.479-.183-.819-.496l.61-.679q.583.453 1.237.453.348 0 .549-.131.209-.139.209-.374 0-.183-.078-.287-.078-.104-.287-.192-.209-.096-.653-.218-.697-.192-1.036-.54-.331-.357-.331-.879 0-.392.226-.705.226-.313.636-.488.418-.183.967-.183zm5.342 4.536q-.253.174-.575.261-.313.096-.627.096-.714-.009-1.08-.409-.366-.401-.366-1.176V3.42h-.688v-.871h.688v-1.01l1.237-.148v1.158h1.062l-.122.871h-.94v2.273q0 .331.113.479.113.148.348.148.235 0 .522-.157zm5.493-4.536q.549 0 .879.374.34.374.34 1.019v3.361h-1.237V4.012q0-.679-.453-.679-.244 0-.427.157-.183.157-.374.488v3.187h-1.237V4.012q0-.679-.453-.679-.244 0-.427.165-.183.157-.366.479v3.187h-1.237V2.549h1.071l.096.575q.261-.348.583-.531.331-.183.758-.183.392 0 .679.2.287.192.418.549.287-.374.618-.557.34-.192.766-.192zm4.148 0q1.036 0 1.62.653.583.644.583 1.794 0 .731-.27 1.289-.261.549-.766.853-.496.305-1.176.305-1.036 0-1.628-.644-.583-.653-.583-1.803 0-.731.261-1.28.27-.557.766-.862.505-.305 1.193-.305zm0 .923q-.47 0-.705.374-.226.366-.226 1.149 0 .784.226 1.158.235.366.697.366.462 0 .688-.366.235-.374.235-1.158 0-.784-.226-1.149-.226-.374-.688-.374zm5.271-.923q.61 0 .949.374.34.366.34 1.019v3.361h-1.237V4.012q0-.374-.131-.522-.122-.157-.374-.157-.261 0-.479.165-.209.157-.409.479v3.187h-1.237V2.549h1.071l.096.583q.287-.357.627-.54.348-.183.784-.183zM40.2.572v6.592h-1.237V.712zm2.804 1.977l-1.472 2.029 1.602 2.586h-1.402l-1.489-2.525 1.48-2.09z"/></svg>
\ No newline at end of file
diff --git a/static/public/static/style.css b/static/public/static/style.css
index 81bfcf3a..3360b91b 100644
--- a/static/public/static/style.css
+++ b/static/public/static/style.css
@@ -102,7 +102,7 @@ input[disabled] {
.container {
margin: 60px auto 15px auto;
- max-width: 550px;
+ max-width: 550px;
}
.wrap {
@@ -190,26 +190,6 @@ input[disabled] {
font-weight: bold;
}
-.login .submit {
- margin-top: 20px;
-}
- .login button {
- width: 100%;
- vertical-align: middle;
- display: flex;
- align-items: center;
- justify-content: center;
- }
- .login button img {
- max-width: 24px;
- margin-right: 10px;
- }
- .login input[name=totp_code] {
- font-size: 2em;
- letter-spacing: 5px;
- text-align: center;
- }
-
footer.container {
margin-top: 15px;
text-align: center;
diff --git a/static/public/templates/admin-base.html b/static/public/templates/admin-base.html
new file mode 100644
index 00000000..56a91870
--- /dev/null
+++ b/static/public/templates/admin-base.html
@@ -0,0 +1,65 @@
+{{ define "admin-public-header" }}
+<!DOCTYPE html>
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+ <title>{{ .Data.Title }} - {{ .SiteName }}</title>
+ <meta name="description" content="{{ .Data.Description }}" />
+ <meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1" />
+ <meta name="color-scheme" content="light dark" />
+ <script>
+ // Saved admin theme or default browser theme preference.
+ (function () {
+ try {
+ var t = localStorage.getItem('theme');
+ if (t === 'light' || t === 'dark') {
+ document.documentElement.style.colorScheme = t;
+ }
+ } catch (e) {}
+ })();
+ </script>
+
+ {{ if .EnablePublicArchive }}
+ <link rel="alternate" type="application/rss+xml" title="{{ L.T "public.archiveTitle" }} - {{ .SiteName }}"
+ href="{{ .RootURL }}/archive.xml" />
+ {{ end }}
+
+ <link href="{{ URI "/admin/static/oat.min.css" }}?v={{ .AssetVersion }}" rel="stylesheet" type="text/css" />
+ <link href="{{ URI "/admin/static/style.css" }}?v={{ .AssetVersion }}" rel="stylesheet" type="text/css" />
+ <link href="/public/custom.css?v={{ .CustomAssetVersion }}" rel="stylesheet" type="text/css">
+ <script src="/public/custom.js?v={{ .CustomAssetVersion }}" async defer></script>
+
+ {{ if ne .FaviconURL "" }}
+ <link rel="icon" href="{{ .FaviconURL }}" type="image/x-icon" />
+ {{ else }}
+ <link rel="icon" href="/public/static/favicon.png?v={{ .AssetVersion }}" type="image/png" />
+ {{ end }}
+</head>
+<body class="admin-public">
+ <div class="public-container">
+ <header class="mb-6">
+ <div class="auth-logo">
+ <a href="{{ if .EnablePublicSubPage }}{{ .RootURL}}/subscription/form{{ end }}">
+ {{ if ne .LogoURL "" }}
+ <img src="{{ .LogoURL }}" alt="{{ .Data.Title }}" />
+ {{ else }}
+ <img src="/public/static/logo.svg?v={{ .AssetVersion }}" alt="{{ .Data.Title }}" />
+ {{ end }}
+ </a>
+ </div>
+ </header>
+ <div class="card">
+{{ end }}
+
+{{ define "admin-public-footer" }}
+ </div>
+
+ <footer class="align-center text-light mt-6">
+ <small>
+ {{ L.T "public.poweredBy" }} <a target="_blank" rel="noreferrer" href="https://listmonk.app">listmonk</a>
+ </small>
+ </footer>
+ </div>
+</body>
+</html>
+{{ end }}
diff --git a/static/public/templates/admin-message.html b/static/public/templates/admin-message.html
new file mode 100644
index 00000000..eed4ab88
--- /dev/null
+++ b/static/public/templates/admin-message.html
@@ -0,0 +1,10 @@
+{{ define "admin-public-message" }}
+ {{ template "admin-public-header" .}}
+
+ <h4 class="page-title">{{ .Data.Title }}</h4>
+ <div>
+ {{ .Data.Message }}
+ </div>
+
+ {{ template "admin-public-footer" .}}
+{{ end }}
diff --git a/static/public/templates/forgot-password.html b/static/public/templates/forgot-password.html
index 2014c28c..a7e3be53 100644
--- a/static/public/templates/forgot-password.html
+++ b/static/public/templates/forgot-password.html
@@ -1,23 +1,21 @@
{{ define "admin-forgot-password" }}
-{{ template "header" .}}
+{{ template "admin-public-header" .}}
-<section class="login">
- <h2>{{ .L.T "users.forgotPassword"}}</h2>
+<section>
+ <h4 class="page-title">{{ .L.T "users.forgotPassword"}}</h4>
- <form method="post" action="/admin/forgot" class="form">
- <div>
- <p>
- <label for="email">{{ .L.T "globals.fields.email" }}</label>
- <input id="email" type="email" name="email" autofocus required />
- </p>
+ <form method="post" action="/admin/forgot">
+ <div data-field>
+ <label for="email">{{ .L.T "globals.fields.email" }}</label>
+ <input id="email" type="email" name="email" autofocus required />
+ </div>
- {{ if .Data.Error }}<p class="error">{{ .Data.Error }}</p>{{ end }}
+ {{ if .Data.Error }}<div role="alert" data-variant="danger" class="mb-4">{{ .Data.Error }}</div>{{ end }}
- <p><button class="button" type="submit">{{ .L.T "globals.buttons.continue" }}</button></p>
- <p class="small"><a href="{{ .RootURL }}/admin/login">&larr; {{ .L.T "globals.buttons.login" }}</a></p>
- </div>
+ <button class="w-100" type="submit">{{ .L.T "globals.buttons.continue" }}</button>
+ <p class="mt-4"><a href="{{ .RootURL }}/admin/login">&larr; {{ .L.T "globals.buttons.login" }}</a></p>
</form>
</section>
-{{ template "footer" .}}
+{{ template "admin-public-footer" .}}
{{ end }}
diff --git a/static/public/templates/login-setup.html b/static/public/templates/login-setup.html
index 432fc00a..55aaf6af 100644
--- a/static/public/templates/login-setup.html
+++ b/static/public/templates/login-setup.html
@@ -1,37 +1,35 @@
{{ define "admin-login-setup" }}
-{{ template "header" .}}
+{{ template "admin-public-header" .}}
-<section class="login">
- <h2>{{ .L.T "users.newUser"}}</h2>
+<section>
+ <h4 class="page-title">{{ .L.T "users.newUser"}}</h4>
<p> {{ .L.T "users.firstTime" }}</p>
- <form method="post" action="" class="form">
- <div>
- <input type="hidden" name="nonce" value="{{ .Data.Nonce }}" />
- <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
- <p>
- <label for="email">{{ .L.T "globals.fields.email" }}</label>
- <input id="email" type="email" name="email" autofocus required minlength="3" />
- </p>
- <p>
- <label for="username">{{ .L.T "globals.fields.username" }}</label>
- <input id="username" type="text" name="username" required minlength="3" />
- </p>
- <p>
- <label for="password">{{ .L.T "globals.fields.password" }}</label>
- <input id="password" type="password" name="password" required minlength="8" />
- </p>
- <p>
- <label for="password2">{{ .L.T "globals.fields.passwordRepeat" }}</label>
- <input id="password2" type="password" name="password2" required minlength="8" />
- </p>
+ <form method="post" action="">
+ <input type="hidden" name="nonce" value="{{ .Data.Nonce }}" />
+ <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
+ <div data-field>
+ <label for="email">{{ .L.T "globals.fields.email" }}</label>
+ <input id="email" type="email" name="email" autofocus required minlength="3" />
+ </div>
+ <div data-field>
+ <label for="username">{{ .L.T "globals.fields.username" }}</label>
+ <input id="username" type="text" name="username" required minlength="3" />
+ </div>
+ <div data-field>
+ <label for="password">{{ .L.T "globals.fields.password" }}</label>
+ <input id="password" type="password" name="password" required minlength="8" />
+ </div>
+ <div data-field>
+ <label for="password2">{{ .L.T "globals.fields.passwordRepeat" }}</label>
+ <input id="password2" type="password" name="password2" required minlength="8" />
+ </div>
- {{ if .Data.Error }}<p><span class="error">{{ .Data.Error }}</span></p>{{ end }}
+ {{ if .Data.Error }}<div role="alert" data-variant="danger" class="mb-4">{{ .Data.Error }}</div>{{ end }}
- <p class="submit"><button class="button" type="submit">{{ .L.T "globals.buttons.continue" }}</button></p>
- </div>
+ <button class="w-100" type="submit">{{ .L.T "globals.buttons.continue" }}</button>
</form>
</section>
-{{ template "footer" .}}
+{{ template "admin-public-footer" .}}
{{ end }}
\ No newline at end of file
diff --git a/static/public/templates/login.html b/static/public/templates/login.html
index b0d42d69..330a1412 100644
--- a/static/public/templates/login.html
+++ b/static/public/templates/login.html
@@ -1,45 +1,41 @@
{{ define "admin-login" }}
-{{ template "header" .}}
+{{ template "admin-public-header" .}}
-<section class="login">
- <h2>{{ .L.T "globals.buttons.login"}}</h2>
+<section>
+ <h4 class="page-title">{{ .L.T "globals.buttons.login"}}</h4>
{{ if .Data.PasswordEnabled }}
- <form method="post" action="/admin/login" class="form">
- <div>
- <input type="hidden" name="nonce" value="{{ .Data.Nonce }}" />
- <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
- <p>
- <label for="username">{{ .L.T "globals.fields.username" }}</label>
- <input id="username" type="text" name="username" autofocus required minlength="3" />
- </p>
- <p>
- <label for="password">{{ .L.T "globals.fields.password" }}</label>
- <input id="password" type="password" name="password" required minlength="8" />
- </p>
+ <form method="post" action="/admin/login">
+ <input type="hidden" name="nonce" value="{{ .Data.Nonce }}" />
+ <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
+ <div data-field>
+ <label for="username">{{ .L.T "globals.fields.username" }}</label>
+ <input id="username" type="text" name="username" autofocus required minlength="3" />
+ </div>
+ <div data-field>
+ <label for="password">{{ .L.T "globals.fields.password" }}</label>
+ <input id="password" type="password" name="password" required minlength="8" />
+ </div>
- {{ if .Data.Error }}<p><span class="error">{{ .Data.Error }}</span></p>{{ end }}
+ {{ if .Data.Error }}<div role="alert" data-variant="danger" class="mb-4">{{ .Data.Error }}</div>{{ end }}
- <p class="submit"><button class="button" type="submit">{{ .L.T "globals.buttons.login" }}</button></p>
- </div>
+ <button class="w-100" type="submit">{{ .L.T "globals.buttons.login" }}</button>
</form>
{{ end }}
{{ if .Data.OIDCProvider }}
- <form method="post" action="/auth/oidc">
- <div>
- <input type="hidden" name="nonce" value="{{ .Data.Nonce }}" />
- <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
- <p><button class="button button-outline" type="submit">
- <img src="{{ .RootURL }}/public/static/auth/{{ .Data.OIDCProviderLogo }}" alt="" />
- {{ .L.Ts "users.loginOIDC" "name" .Data.OIDCProvider }}
- </button></p>
- </div>
+ <form method="post" action="/auth/oidc" class="mt-4">
+ <input type="hidden" name="nonce" value="{{ .Data.Nonce }}" />
+ <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
+ <button type="submit" data-variant="secondary" class="w-100">
+ <img src="{{ .RootURL }}/public/static/auth/{{ .Data.OIDCProviderLogo }}" alt="" width="24" height="24" />
+ {{ .L.Ts "users.loginOIDC" "name" .Data.OIDCProvider }}
+ </button>
</form>
{{ end }}
- <p class="center small"><a href="{{ .RootURL }}/admin/forgot">{{ .L.T "users.forgotPassword" }}</a></p>
+ <p class="align-center mt-4"><a href="{{ .RootURL }}/admin/forgot">{{ .L.T "users.forgotPassword" }}</a></p>
</section>
-{{ template "footer" .}}
+{{ template "admin-public-footer" .}}
{{ end }}
\ No newline at end of file
diff --git a/static/public/templates/reset-password.html b/static/public/templates/reset-password.html
index a8327148..1150a299 100644
--- a/static/public/templates/reset-password.html
+++ b/static/public/templates/reset-password.html
@@ -1,26 +1,24 @@
{{ define "admin-reset-password" }}
-{{ template "header" .}}
+{{ template "admin-public-header" .}}
-<section class="login">
- <h2>{{ .L.T "users.resetPassword"}}</h2>
+<section>
+ <h4 class="page-title">{{ .L.T "users.resetPassword"}}</h4>
- <form method="post" action="/admin/reset?token={{ .Data.Token }}&email={{ .Data.Email }}" class="form">
- <div>
- <p>
- <label for="password">{{ .L.T "globals.fields.newPassword" }}</label>
- <input id="password" type="password" name="password" autofocus required minlength="8" />
- </p>
- <p>
- <label for="password2">{{ .L.T "globals.fields.passwordRepeat" }}</label>
- <input id="password2" type="password" name="password2" required minlength="8" />
- </p>
+ <form method="post" action="/admin/reset?token={{ .Data.Token }}&email={{ .Data.Email }}">
+ <div data-field>
+ <label for="password">{{ .L.T "globals.fields.newPassword" }}</label>
+ <input id="password" type="password" name="password" autofocus required minlength="8" />
+ </div>
+ <div data-field>
+ <label for="password2">{{ .L.T "globals.fields.passwordRepeat" }}</label>
+ <input id="password2" type="password" name="password2" required minlength="8" />
+ </div>
- {{ if .Data.Error }}<p><span class="error">{{ .Data.Error }}</span></p>{{ end }}
+ {{ if .Data.Error }}<div role="alert" data-variant="danger" class="mb-4">{{ .Data.Error }}</div>{{ end }}
- <p class="submit"><button class="button" type="submit">{{ .L.T "users.resetPassword" }}</button></p>
- </div>
+ <button class="w-100" type="submit">{{ .L.T "users.resetPassword" }}</button>
</form>
</section>
-{{ template "footer" .}}
+{{ template "admin-public-footer" .}}
{{ end }}
diff --git a/static/public/templates/twofa.html b/static/public/templates/twofa.html
index 28dd3347..da3812db 100644
--- a/static/public/templates/twofa.html
+++ b/static/public/templates/twofa.html
@@ -1,25 +1,23 @@
{{ define "admin-twofa" }}
-{{ template "header" .}}
+{{ template "admin-public-header" .}}
-<section class="login">
- <h2>{{ .L.T "users.twoFA"}}</h2>
- <p>{{ .L.T "users.totpCodeHelp" }}</p>
+<section>
+ <h4 class="page-title">{{ .L.T "users.twoFA"}}</h4>
- <form method="post" action="/admin/login/twofa" class="form">
- <div>
- <input type="hidden" name="token" value="{{ .Data.Token }}" />
- <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
- <p>
- <input id="totp_code" type="text" name="totp_code" autofocus required
- pattern="[0-9]{6}" maxlength="6" placeholder="• • • • • •" aria-label="{{ .L.T "users.totpCode" }}" />
- </p>
+ <form method="post" action="/admin/login/twofa">
+ <input type="hidden" name="token" value="{{ .Data.Token }}" />
+ <input type="hidden" name="next" value="{{ .Data.NextURI }}" />
+ <div data-field>
+ <input id="totp_code" class="align-center" inputmode="numeric" autocomplete="one-time-code" type="text" name="totp_code" autofocus required
+ pattern="[0-9]{6}" maxlength="6" placeholder="• • • • • •" aria-label="{{ .L.T "users.totpCode" }}" aria-describedby="totp-help" />
+ <small id="totp-help" data-hint>{{ .L.T "users.totpCodeHelp" }}</small>
+ </div>
- {{ if .Data.Error }}<p><span class="error">{{ .Data.Error }}</span></p>{{ end }}
+ {{ if .Data.Error }}<div role="alert" data-variant="danger" class="mb-4">{{ .Data.Error }}</div>{{ end }}
- <p class="submit"><button class="button" type="submit">{{ .L.T "globals.buttons.continue" }}</button></p>
- </div>
+ <button class="w-100" type="submit">{{ .L.T "globals.buttons.continue" }}</button>
</form>
</section>
-{{ template "footer" .}}
+{{ template "admin-public-footer" .}}
{{ end }}