diff options
author | René 'Necoro' Neumann <necoro@necoro.eu> | 2024-02-15 12:57:42 +0100 |
---|---|---|
committer | René 'Necoro' Neumann <necoro@necoro.eu> | 2024-02-15 12:57:42 +0100 |
commit | a1e4e08c1d13c87983a89a887876e77036644e2c (patch) | |
tree | 4515c1425d2c7415ae9894421ffd3451fbc99cc8 /templ | |
parent | b3485c78114e505b7bc9c6969afa108ea3f4755c (diff) | |
download | gosten-a1e4e08c1d13c87983a89a887876e77036644e2c.tar.gz gosten-a1e4e08c1d13c87983a89a887876e77036644e2c.tar.bz2 gosten-a1e4e08c1d13c87983a89a887876e77036644e2c.zip |
Start styling with bootstrap
Diffstat (limited to '')
-rw-r--r-- | templ/base.tpl | 4 | ||||
-rw-r--r-- | templ/form.tpl | 27 | ||||
-rw-r--r-- | templ/login.tpl | 13 |
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 |