summaryrefslogtreecommitdiff
path: root/templ
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--templ/base.tpl4
-rw-r--r--templ/form.tpl27
-rw-r--r--templ/login.tpl13
3 files changed, 27 insertions, 17 deletions
diff --git a/templ/base.tpl b/templ/base.tpl
index 89e095f..af248dd 100644
--- a/templ/base.tpl
+++ b/templ/base.tpl
@@ -2,8 +2,10 @@
<html lang="de">
<head>
<meta charset="UTF-8">
+ <meta name="viewport" content="width=device-width, initial-scale=1">
<title>{{block "title" .}}Kosten{{end}}</title>
- <link rel="stylesheet" href="/static/style.css">
+ <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
+ <script defer src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</head>
<body>
{{block "body" .}}
diff --git a/templ/form.tpl b/templ/form.tpl
index deb8d58..4d20557 100644
--- a/templ/form.tpl
+++ b/templ/form.tpl
@@ -1,17 +1,22 @@
{{define "formItem"}}
- <label {{with .ID}}for="{{.}}"{{end}}>{{.Label}}</label>
- <input
- {{with .ID}}id="{{.}}"{{end}}
- type="{{.Type}}"
- name="{{.Name}}"
- placeholder="{{.Placeholder}}"
- {{with .Value}}value="{{.}}"{{end}}
- {{with .Class}}class="{{.}}"{{end}}
- {{range .Options}} {{.}} {{end}}
- >
+ {{- $cb := eq .Type "checkbox" -}}
+ <div class="{{if $cb}}form-check form-switch{{else}}form-floating{{end}} mb-3">
+ <input
+ {{with .ID}}id="{{.}}"{{end}}
+ type="{{.Type}}"
+ name="{{.Name}}"
+ placeholder="{{.Placeholder}}"
+ {{with .Value}}value="{{.}}"{{end}}
+ {{with .Class}}class="{{.}}"{{end}}
+ class="{{if $cb}}form-check-input{{else}}form-control{{end}}"
+ {{range .Options}} {{.}} {{end}}
+ >
+ <label {{with .ID}}for="{{.}}"{{end}}
+ {{- if $cb}}class="form-check-label"{{end}}>{{.Label}}</label>
+
{{range errors}}
<p style="color:red">{{.}}</p>
{{end}}
{{with .Footer}}<p>{{.}}</p>{{end}}
- <br />
+ </div>
{{end}} \ No newline at end of file
diff --git a/templ/login.tpl b/templ/login.tpl
index 205b030..a0c17d1 100644
--- a/templ/login.tpl
+++ b/templ/login.tpl
@@ -1,7 +1,10 @@
{{define "body"}}
- <form action="/login" method="post">
- {{inputs_and_errors_for . .Errors}}
- {{.CsrfField}}
- <button type="submit">Log In!</button>
- </form>
+ <main class="d-flex align-items-center min-vh-100">
+ <form action="/login" method="post" class="container m-auto" style="max-width: 440px;">
+ <img src="/static/euro-money.svg" width="96" height="96" class="mb-4"/>
+ {{inputs_and_errors_for . .Errors}}
+ {{.CsrfField}}
+ <button class="btn btn-primary w-100" type="submit">Log In!</button>
+ </form>
+ </main>
{{end}} \ No newline at end of file