summaryrefslogtreecommitdiffhomepage
path: root/templates/base.templ
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2024-08-11 03:13:10 +0200
committerThomas Voss <mail@thomasvoss.com> 2024-08-11 03:16:36 +0200
commit3273c65ef82123bf5edbe6d8616630b20a993ce1 (patch)
treed230d18f60122f3a1b65056df197ad1db0ca41b0 /templates/base.templ
parent3e723305c61673a767da25f683777de368899d41 (diff)
Giant refactoring of the codebase
Diffstat (limited to 'templates/base.templ')
-rw-r--r--templates/base.templ59
1 files changed, 0 insertions, 59 deletions
diff --git a/templates/base.templ b/templates/base.templ
deleted file mode 100644
index e6c4a1d..0000000
--- a/templates/base.templ
+++ /dev/null
@@ -1,59 +0,0 @@
-package templates
-
-import "git.thomasvoss.com/euro-cash.eu/i18n"
-
-templ Base(head, body templ.Component) {
- {{ p := ctx.Value("printer").(i18n.Printer) }}
- <!DOCTYPE html>
- <html lang={ p.Locale.Bcp }>
- <head>
- <meta charset="UTF-8"/>
- <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
- <link rel="stylesheet" type="text/css" href="/style.css"/>
- <title>Euro Cash</title>
- <script type="text/javascript">
- const validate = theme =>
- ["light", "dark"].includes(theme) ? theme : "light";
-
- const toggle = theme =>
- theme == "light" ? "dark" : "light";
-
- const setTheme = theme => {
- localStorage.setItem("theme", theme);
- document
- .getElementsByTagName("html")[0]
- .setAttribute("data-theme", theme);
- document
- .getElementById(`nav-icon-theme-${theme}`)
- .style.display = '';
- document
- .getElementById(`nav-icon-theme-${toggle(theme)}`)
- .style.display = 'none';
- };
-
- document.addEventListener('DOMContentLoaded', _ => {
- document.getElementById("theme-button").onclick = () => {
- setTheme(toggle(validate(localStorage.getItem("theme"))));
- };
- setTheme(validate(localStorage.getItem("theme")));
- });
- </script>
- if head != nil {
- @head
- }
- </head>
- <body>
- if body != nil {
- @body
- }
- <footer>
- <p>
- <small>
- { p.T("Found a mistake or want to contribute missing information?") }
- <a href="/">{ p.T("Feel free to contact us!") }</a>
- </small>
- </p>
- </footer>
- </body>
- </html>
-}