refactor: change styling to catppuccin macchiato
This commit is contained in:
parent
85a867753d
commit
0a4efb8630
5 changed files with 319 additions and 298 deletions
|
|
@ -1,18 +1,8 @@
|
|||
# This is an example .goreleaser.yml file with some sensible defaults.
|
||||
# Make sure to check the documentation at https://goreleaser.com
|
||||
|
||||
# The lines below are called `modelines`. See `:help modeline`
|
||||
# Feel free to remove those if you don't want/need to use them.
|
||||
# yaml-language-server: $schema=https://goreleaser.com/static/schema.json
|
||||
# vim: set ts=2 sw=2 tw=0 fo=cnqoj
|
||||
|
||||
version: 2
|
||||
|
||||
before:
|
||||
hooks:
|
||||
# You may remove this if you don't use go modules.
|
||||
- go mod tidy
|
||||
# you may remove this if you don't need go generate
|
||||
- go generate ./...
|
||||
|
||||
builds:
|
||||
|
|
@ -27,7 +17,6 @@ builds:
|
|||
|
||||
archives:
|
||||
- format: tar.gz
|
||||
# this name template makes the OS and Arch compatible with the results of `uname`.
|
||||
name_template: >-
|
||||
{{ .ProjectName }}_
|
||||
{{- title .Os }}_
|
||||
|
|
@ -35,7 +24,6 @@ archives:
|
|||
{{- else if eq .Arch "386" }}i386
|
||||
{{- else }}{{ .Arch }}{{ end }}
|
||||
{{- if .Arm }}v{{ .Arm }}{{ end }}
|
||||
# use zip for windows archives
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
format: zip
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
# echoTest
|
||||
# Englischnoten
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@ package controllers
|
|||
|
||||
import (
|
||||
"echoTest/models"
|
||||
"echoTest/templates"
|
||||
"strconv"
|
||||
|
||||
"github.com/labstack/echo/v4"
|
||||
|
|
@ -17,5 +18,6 @@ func (c *Controller) ToggleWertungRoute(ctx echo.Context) error {
|
|||
break
|
||||
}
|
||||
}
|
||||
return c.CreateBewertungNode(updatedBewertung).Render(ctx.Request().Context(), ctx.Response().Writer)
|
||||
// return c.CreateBewertungNode(updatedBewertung).Render(ctx.Request().Context(), ctx.Response().Writer)
|
||||
return templates.BewertungRow(updatedBewertung).Render(ctx.Request().Context(), ctx.Response().Writer)
|
||||
}
|
||||
|
|
|
|||
|
|
@ -8,85 +8,85 @@ import (
|
|||
|
||||
templ layout(title string) {
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<html data-theme="light">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>{title}</title>
|
||||
<script src="https://unpkg.com/htmx.org@1.9.6"></script>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css" />
|
||||
<link href="https://cdn.jsdelivr.net/npm/daisyui@4.12.14/dist/full.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@catppuccin/daisyui@1.2.1/dist/catppuccin.css" />
|
||||
<script src="https://cdn.tailwindcss.com"></script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<nav class="navbar" role="navigation" aria-label="main navigation">
|
||||
<div id="navbarBasicExample" class="navbar-menu">
|
||||
<div class="navbar-start">
|
||||
<a class="navbar-item">Home</a>
|
||||
<div data-theme="macchiato">
|
||||
<div class="navbar bg-base-100">
|
||||
<div class="flex-1">
|
||||
<a class="btn btn-ghost normal-case text-xl">Home</a>
|
||||
</div>
|
||||
<div class="navbar-end">
|
||||
<span class="navbar-item">
|
||||
<button class="button is-primary" hx-get="/end">Beenden</button>
|
||||
</span>
|
||||
<div class="flex-none">
|
||||
<button class="btn btn-primary" hx-get="/end">Beenden</button>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container is-widescreen">
|
||||
<div class="container mx-auto p-4">
|
||||
{children...}
|
||||
</div>
|
||||
<footer class="footer">
|
||||
<div class="content has-text-centered">
|
||||
<footer class="footer footer-center p-4 bg-base-300 text-base-content">
|
||||
<div>
|
||||
<p>© 2023 Alle Rechte vorbehalten.</p>
|
||||
</div>
|
||||
</footer>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
}
|
||||
|
||||
templ BewertungenForm(maxPunkte models.MaxPunkte) {
|
||||
<form method="post" action="/add">
|
||||
<div class="tile is-ancestor">
|
||||
<div class="tile field is-parent">
|
||||
<input class="input is-child" type="text" name="hv_max" placeholder="HV-Max-Punkte" value={fmt.Sprintf("%.2f",
|
||||
<form method="post" action="/add" class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-4">
|
||||
<div class="form-control">
|
||||
<label for="hv_max" class="label">HV Punkte</label>
|
||||
<input id="hv_max" class="input input-bordered" type="text" name="hv_max" value={fmt.Sprintf("%.2f",
|
||||
maxPunkte.HvMax)} />
|
||||
</div>
|
||||
<div class="tile field is-parent">
|
||||
<input class="input is-child" type="text" name="hv_gewichtung" placeholder="HV-Gewichtung in %"
|
||||
value={fmt.Sprintf("%.2f", maxPunkte.HvGewichtung)} />
|
||||
<div class="form-control">
|
||||
<label for="hv_gewichtung" class="label">HV Gewichtung in %</label>
|
||||
<input id="hv_gewichtung" class="input input-bordered" type="text" name="hv_gewichtung" value={fmt.Sprintf("%.2f",
|
||||
maxPunkte.HvGewichtung)} />
|
||||
</div>
|
||||
<div class="tile field is-parent">
|
||||
<input class="input is-child" type="text" name="lv_max" placeholder="LV-Max-Punkte" value={fmt.Sprintf("%.2f",
|
||||
<div class="form-control">
|
||||
<label for="lv_max" class="label">LV Punkte</label>
|
||||
<input id="lv_max" class="input input-bordered" type="text" name="lv_max" value={fmt.Sprintf("%.2f",
|
||||
maxPunkte.LvMax)} />
|
||||
</div>
|
||||
<div class="tile field is-parent">
|
||||
<input class="input is-child" type="text" name="lv_gewichtung" placeholder="LV-Gewichtung in %"
|
||||
value={fmt.Sprintf("%.2f", maxPunkte.LvGewichtung)} />
|
||||
<div class="form-control">
|
||||
<label for="lv_gewichtung" class="label">LV Gewichtung in %</label>
|
||||
<input id="lv_gewichtung" class="input input-bordered" type="text" name="lv_gewichtung" value={fmt.Sprintf("%.2f",
|
||||
maxPunkte.LvGewichtung)} />
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<input type="text" name="vorname" class="input input-bordered" placeholder="Vorname" />
|
||||
</div>
|
||||
<div class="tile is-ancestor">
|
||||
<div class="tile field is-parent">
|
||||
<input type="text" name="vorname" class="input is-child" placeholder="Vorname" />
|
||||
<div class="form-control">
|
||||
<input type="text" name="nachname" class="input input-bordered" placeholder="Nachname" />
|
||||
</div>
|
||||
<div class="tile field is-parent">
|
||||
<input type="text" name="nachname" class="input is-child" placeholder="Nachname" />
|
||||
<div class="form-control">
|
||||
<input type="text" name="hv_punkte" class="input input-bordered" placeholder="HV-Punkte" />
|
||||
</div>
|
||||
<div class="tile field is-parent">
|
||||
<input type="text" name="hv_punkte" class="input is-child" placeholder="HV-Punkte" />
|
||||
</div>
|
||||
<div class="tile field is-parent">
|
||||
<input type="text" name="lv_punkte" class="input is-child" placeholder="LV-Punkte" />
|
||||
</div>
|
||||
<div class="tile field is-parent">
|
||||
<button type="submit" class="button tile is-child">Add</button>
|
||||
<div class="form-control">
|
||||
<input type="text" name="lv_punkte" class="input input-bordered" placeholder="LV-Punkte" />
|
||||
</div>
|
||||
<div class="form-control">
|
||||
<button type="submit" class="btn btn-primary">Add</button>
|
||||
</div>
|
||||
</form>
|
||||
}
|
||||
|
||||
templ BewertungenTable(bewertungen []models.Bewertung) {
|
||||
<div class="table-container">
|
||||
<table class="table is-hoverable">
|
||||
<div class="overflow-x-auto">
|
||||
<table class="table table-zebra">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Gewertet</th>
|
||||
|
|
@ -104,9 +104,17 @@ templ BewertungenTable(bewertungen []models.Bewertung) {
|
|||
</thead>
|
||||
<tbody>
|
||||
for _, b := range bewertungen {
|
||||
@BewertungRow(b)
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ BewertungRow(b models.Bewertung) {
|
||||
<tr id={"bewertung-" + strconv.Itoa(b.ID)}>
|
||||
<td>
|
||||
<input type="checkbox" checked?={b.Gewertet} hx-post={"/toggle/" + strconv.Itoa(b.ID)}
|
||||
<input type="checkbox" class="toggle" checked?={b.Gewertet} hx-post={"/toggle/" + strconv.Itoa(b.ID)}
|
||||
hx-target={"#bewertung-" + strconv.Itoa(b.ID)} hx-swap="outerHTML" />
|
||||
</td>
|
||||
<td>{b.Vorname}</td>
|
||||
|
|
@ -121,25 +129,17 @@ templ BewertungenTable(bewertungen []models.Bewertung) {
|
|||
<td>{strconv.Itoa(b.GesamtNote)}</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
}
|
||||
|
||||
templ BewertungenPage(bewertungen []models.Bewertung, maxPunkte models.MaxPunkte) {
|
||||
@layout("Englischarbeit") {
|
||||
<div class="card tile is-vertical is-ancestor">
|
||||
<header class="card-header">
|
||||
<p class="card-header-title">Englischarbeit</p>
|
||||
</header>
|
||||
<div class="card-content">
|
||||
<div class="content tile is-parent is-vertical gap">
|
||||
<h1 class="title">Bewertungen</h1>
|
||||
<div class="card bg-base-100 shadow-xl">
|
||||
<div class="card-body">
|
||||
<h2 class="card-title">Englischarbeit</h2>
|
||||
<h3 class="text-lg font-bold">Bewertungen</h3>
|
||||
@BewertungenForm(maxPunkte)
|
||||
@BewertungenTable(bewertungen)
|
||||
<div>
|
||||
<button hx-get="/export" class="button">export</button>
|
||||
</div>
|
||||
<div class="card-actions justify-end">
|
||||
<button hx-get="/export" class="btn btn-primary">Export</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ func layout(title string) templ.Component {
|
|||
templ_7745c5c3_Var1 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<!doctype html><html data-theme=\"light\"><head><meta charset=\"UTF-8\"><meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"><title>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -48,7 +48,7 @@ func layout(title string) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><script src=\"https://unpkg.com/htmx.org@1.9.6\"></script><link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/bulma@0.9.4/css/bulma.min.css\"></head><body><nav class=\"navbar\" role=\"navigation\" aria-label=\"main navigation\"><div id=\"navbarBasicExample\" class=\"navbar-menu\"><div class=\"navbar-start\"><a class=\"navbar-item\">Home</a></div><div class=\"navbar-end\"><span class=\"navbar-item\"><button class=\"button is-primary\" hx-get=\"/end\">Beenden</button></span></div></div></nav><div class=\"container is-widescreen\">")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</title><script src=\"https://unpkg.com/htmx.org@1.9.6\"></script><link href=\"https://cdn.jsdelivr.net/npm/daisyui@4.12.14/dist/full.css\" rel=\"stylesheet\" type=\"text/css\"><link rel=\"stylesheet\" href=\"https://cdn.jsdelivr.net/npm/@catppuccin/daisyui@1.2.1/dist/catppuccin.css\"><script src=\"https://cdn.tailwindcss.com\"></script></head><body><div data-theme=\"macchiato\"><div class=\"navbar bg-base-100\"><div class=\"flex-1\"><a class=\"btn btn-ghost normal-case text-xl\">Home</a></div><div class=\"flex-none\"><button class=\"btn btn-primary\" hx-get=\"/end\">Beenden</button></div></div><div class=\"container mx-auto p-4\">")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -56,7 +56,7 @@ func layout(title string) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><footer class=\"footer\"><div class=\"content has-text-centered\"><p>© 2023 Alle Rechte vorbehalten.</p></div></footer></body></html>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</div><footer class=\"footer footer-center p-4 bg-base-300 text-base-content\"><div><p>© 2023 Alle Rechte vorbehalten.</p></div></footer></div></body></html>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -85,7 +85,7 @@ func BewertungenForm(maxPunkte models.MaxPunkte) templ.Component {
|
|||
templ_7745c5c3_Var3 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form method=\"post\" action=\"/add\"><div class=\"tile is-ancestor\"><div class=\"tile field is-parent\"><input class=\"input is-child\" type=\"text\" name=\"hv_max\" placeholder=\"HV-Max-Punkte\" value=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<form method=\"post\" action=\"/add\" class=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-4 mb-4\"><div class=\"form-control\"><label for=\"hv_max\" class=\"label\">HV Punkte</label> <input id=\"hv_max\" class=\"input input-bordered\" type=\"text\" name=\"hv_max\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -93,26 +93,27 @@ func BewertungenForm(maxPunkte models.MaxPunkte) templ.Component {
|
|||
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f",
|
||||
maxPunkte.HvMax))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 52, Col: 24}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 52, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"tile field is-parent\"><input class=\"input is-child\" type=\"text\" name=\"hv_gewichtung\" placeholder=\"HV-Gewichtung in %\" value=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"form-control\"><label for=\"hv_gewichtung\" class=\"label\">HV Gewichtung in %</label> <input id=\"hv_gewichtung\" class=\"input input-bordered\" type=\"text\" name=\"hv_gewichtung\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var5 string
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", maxPunkte.HvGewichtung))
|
||||
templ_7745c5c3_Var5, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f",
|
||||
maxPunkte.HvGewichtung))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 56, Col: 58}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 57, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var5))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"tile field is-parent\"><input class=\"input is-child\" type=\"text\" name=\"lv_max\" placeholder=\"LV-Max-Punkte\" value=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"form-control\"><label for=\"lv_max\" class=\"label\">LV Punkte</label> <input id=\"lv_max\" class=\"input input-bordered\" type=\"text\" name=\"lv_max\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -120,26 +121,27 @@ func BewertungenForm(maxPunkte models.MaxPunkte) templ.Component {
|
|||
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f",
|
||||
maxPunkte.LvMax))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 60, Col: 24}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 62, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"tile field is-parent\"><input class=\"input is-child\" type=\"text\" name=\"lv_gewichtung\" placeholder=\"LV-Gewichtung in %\" value=\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"form-control\"><label for=\"lv_gewichtung\" class=\"label\">LV Gewichtung in %</label> <input id=\"lv_gewichtung\" class=\"input input-bordered\" type=\"text\" name=\"lv_gewichtung\" value=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var7 string
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", maxPunkte.LvGewichtung))
|
||||
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f",
|
||||
maxPunkte.LvGewichtung))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 64, Col: 58}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 67, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div></div><div class=\"tile is-ancestor\"><div class=\"tile field is-parent\"><input type=\"text\" name=\"vorname\" class=\"input is-child\" placeholder=\"Vorname\"></div><div class=\"tile field is-parent\"><input type=\"text\" name=\"nachname\" class=\"input is-child\" placeholder=\"Nachname\"></div><div class=\"tile field is-parent\"><input type=\"text\" name=\"hv_punkte\" class=\"input is-child\" placeholder=\"HV-Punkte\"></div><div class=\"tile field is-parent\"><input type=\"text\" name=\"lv_punkte\" class=\"input is-child\" placeholder=\"LV-Punkte\"></div><div class=\"tile field is-parent\"><button type=\"submit\" class=\"button tile is-child\">Add</button></div></div></form>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"></div><div class=\"form-control\"><input type=\"text\" name=\"vorname\" class=\"input input-bordered\" placeholder=\"Vorname\"></div><div class=\"form-control\"><input type=\"text\" name=\"nachname\" class=\"input input-bordered\" placeholder=\"Nachname\"></div><div class=\"form-control\"><input type=\"text\" name=\"hv_punkte\" class=\"input input-bordered\" placeholder=\"HV-Punkte\"></div><div class=\"form-control\"><input type=\"text\" name=\"lv_punkte\" class=\"input input-bordered\" placeholder=\"LV-Punkte\"></div><div class=\"form-control\"><button type=\"submit\" class=\"btn btn-primary\">Add</button></div></form>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -168,25 +170,59 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
templ_7745c5c3_Var8 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"table-container\"><table class=\"table is-hoverable\"><thead><tr><th>Gewertet</th><th>Vorname</th><th>Nachname</th><th>HV-Punkte</th><th>HV-Prozent</th><th>HV-Note</th><th>LV-Punkte</th><th>LV-Prozent</th><th>LV-Note</th><th>Gesamt-Prozent</th><th>Gesamt-Note</th></tr></thead> <tbody>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"overflow-x-auto\"><table class=\"table table-zebra\"><thead><tr><th>Gewertet</th><th>Vorname</th><th>Nachname</th><th>HV-Punkte</th><th>HV-Prozent</th><th>HV-Note</th><th>LV-Punkte</th><th>LV-Prozent</th><th>LV-Note</th><th>Gesamt-Prozent</th><th>Gesamt-Note</th></tr></thead> <tbody>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
for _, b := range bewertungen {
|
||||
templ_7745c5c3_Err = BewertungRow(b).Render(ctx, templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</tbody></table></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
}
|
||||
|
||||
func BewertungRow(b models.Bewertung) templ.Component {
|
||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
if templ_7745c5c3_CtxErr := ctx.Err(); templ_7745c5c3_CtxErr != nil {
|
||||
return templ_7745c5c3_CtxErr
|
||||
}
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
defer func() {
|
||||
templ_7745c5c3_BufErr := templruntime.ReleaseBuffer(templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err == nil {
|
||||
templ_7745c5c3_Err = templ_7745c5c3_BufErr
|
||||
}
|
||||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var9 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var9 == nil {
|
||||
templ_7745c5c3_Var9 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<tr id=\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var9 string
|
||||
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinStringErrs("bewertung-" + strconv.Itoa(b.ID))
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("bewertung-" + strconv.Itoa(b.ID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 107, Col: 47}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 115, Col: 41}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><td><input type=\"checkbox\"")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("\"><td><input type=\"checkbox\" class=\"toggle\"")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -200,12 +236,12 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var10 string
|
||||
templ_7745c5c3_Var10, templ_7745c5c3_Err = templ.JoinStringErrs("/toggle/" + strconv.Itoa(b.ID))
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs("/toggle/" + strconv.Itoa(b.ID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 109, Col: 95}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 117, Col: 104}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var10))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -213,12 +249,12 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var11 string
|
||||
templ_7745c5c3_Var11, templ_7745c5c3_Err = templ.JoinStringErrs("#bewertung-" + strconv.Itoa(b.ID))
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs("#bewertung-" + strconv.Itoa(b.ID))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 110, Col: 57}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 118, Col: 51}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var11))
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -226,23 +262,10 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var12 string
|
||||
templ_7745c5c3_Var12, templ_7745c5c3_Err = templ.JoinStringErrs(b.Vorname)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 112, Col: 22}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var12))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var13 string
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(b.Nachname)
|
||||
templ_7745c5c3_Var13, templ_7745c5c3_Err = templ.JoinStringErrs(b.Vorname)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 113, Col: 23}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 120, Col: 16}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var13))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -253,9 +276,9 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var14 string
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.HvPunkte))
|
||||
templ_7745c5c3_Var14, templ_7745c5c3_Err = templ.JoinStringErrs(b.Nachname)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 114, Col: 44}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 121, Col: 17}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var14))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -266,9 +289,9 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var15 string
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.HvProzent))
|
||||
templ_7745c5c3_Var15, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.HvPunkte))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 115, Col: 45}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 122, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var15))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -279,9 +302,9 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var16 string
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(b.HvNote))
|
||||
templ_7745c5c3_Var16, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.HvProzent))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 116, Col: 35}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 123, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var16))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -292,9 +315,9 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var17 string
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.LvPunkte))
|
||||
templ_7745c5c3_Var17, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(b.HvNote))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 117, Col: 44}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 124, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var17))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -305,9 +328,9 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var18 string
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.LvProzent))
|
||||
templ_7745c5c3_Var18, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.LvPunkte))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 118, Col: 45}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 125, Col: 38}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var18))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -318,9 +341,9 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var19 string
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(b.LvNote))
|
||||
templ_7745c5c3_Var19, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.LvProzent))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 119, Col: 35}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 126, Col: 39}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var19))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -331,9 +354,9 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var20 string
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.GesamtProzent))
|
||||
templ_7745c5c3_Var20, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(b.LvNote))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 120, Col: 49}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 127, Col: 29}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var20))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
|
|
@ -344,20 +367,28 @@ func BewertungenTable(bewertungen []models.Bewertung) templ.Component {
|
|||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var21 string
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(b.GesamtNote))
|
||||
templ_7745c5c3_Var21, templ_7745c5c3_Err = templ.JoinStringErrs(fmt.Sprintf("%.2f", b.GesamtProzent))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 121, Col: 39}
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 128, Col: 43}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var21))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td><td>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
var templ_7745c5c3_Var22 string
|
||||
templ_7745c5c3_Var22, templ_7745c5c3_Err = templ.JoinStringErrs(strconv.Itoa(b.GesamtNote))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ.Error{Err: templ_7745c5c3_Err, FileName: `templates/templates.templ`, Line: 129, Col: 33}
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</tbody></table></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var22))
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("</td></tr>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -381,12 +412,12 @@ func BewertungenPage(bewertungen []models.Bewertung, maxPunkte models.MaxPunkte)
|
|||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
templ_7745c5c3_Var22 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var22 == nil {
|
||||
templ_7745c5c3_Var22 = templ.NopComponent
|
||||
templ_7745c5c3_Var23 := templ.GetChildren(ctx)
|
||||
if templ_7745c5c3_Var23 == nil {
|
||||
templ_7745c5c3_Var23 = templ.NopComponent
|
||||
}
|
||||
ctx = templ.ClearChildren(ctx)
|
||||
templ_7745c5c3_Var23 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_Var24 := templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||
templ_7745c5c3_W, ctx := templ_7745c5c3_Input.Writer, templ_7745c5c3_Input.Context
|
||||
templ_7745c5c3_Buffer, templ_7745c5c3_IsBuffer := templruntime.GetBuffer(templ_7745c5c3_W)
|
||||
if !templ_7745c5c3_IsBuffer {
|
||||
|
|
@ -398,7 +429,7 @@ func BewertungenPage(bewertungen []models.Bewertung, maxPunkte models.MaxPunkte)
|
|||
}()
|
||||
}
|
||||
ctx = templ.InitializeContext(ctx)
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"card tile is-vertical is-ancestor\"><header class=\"card-header\"><p class=\"card-header-title\">Englischarbeit</p></header><div class=\"card-content\"><div class=\"content tile is-parent is-vertical gap\"><h1 class=\"title\">Bewertungen</h1>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"card bg-base-100 shadow-xl\"><div class=\"card-body\"><h2 class=\"card-title\">Englischarbeit</h2><h3 class=\"text-lg font-bold\">Bewertungen</h3>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
@ -410,13 +441,13 @@ func BewertungenPage(bewertungen []models.Bewertung, maxPunkte models.MaxPunkte)
|
|||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div><button hx-get=\"/export\" class=\"button\">export</button></div></div></div></div>")
|
||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"card-actions justify-end\"><button hx-get=\"/export\" class=\"btn btn-primary\">Export</button></div></div></div>")
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
return templ_7745c5c3_Err
|
||||
})
|
||||
templ_7745c5c3_Err = layout("Englischarbeit").Render(templ.WithChildren(ctx, templ_7745c5c3_Var23), templ_7745c5c3_Buffer)
|
||||
templ_7745c5c3_Err = layout("Englischarbeit").Render(templ.WithChildren(ctx, templ_7745c5c3_Var24), templ_7745c5c3_Buffer)
|
||||
if templ_7745c5c3_Err != nil {
|
||||
return templ_7745c5c3_Err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue