unshitify code

This commit is contained in:
2025-12-10 10:42:03 +00:00
parent 3306c7efa9
commit aef0be80fc
2 changed files with 67 additions and 530 deletions

View File

@@ -6,6 +6,16 @@ import (
"github.com/b2dennis/meshi/csv"
)
var weekdays = [7]string{
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag",
"Sonntag",
}
templ Home(plan csv.Plan) {
<!DOCTYPE html>
<html lang="en">
@@ -34,73 +44,21 @@ templ Home(plan csv.Plan) {
}
}
}
@table.Row() {
@table.Cell() {
Montag
}
for _, menu := range plan.Menus[0] {
@table.Cell() {
{menu}
for i,day := range(weekdays) {
{{
class := ""
if i == 6 {
class = "border-b-0"
}
}
}
@table.Row() {
@table.Cell() {
Dienstag
}
for _, menu := range plan.Menus[1] {
}}
@table.Row(table.RowProps{Class: class}) {
@table.Cell() {
{menu}
{day}
}
}
}
@table.Row() {
@table.Cell() {
Mittwoch
}
for _, menu := range plan.Menus[2] {
@table.Cell() {
{menu}
}
}
}
@table.Row() {
@table.Cell() {
Donnerstag
}
for _, menu := range plan.Menus[3] {
@table.Cell() {
{menu}
}
}
}
@table.Row() {
@table.Cell() {
Freitag
}
for _, menu := range plan.Menus[4] {
@table.Cell() {
{menu}
}
}
}
@table.Row() {
@table.Cell() {
Samstag
}
for _, menu := range plan.Menus[5] {
@table.Cell() {
{menu}
}
}
}
@table.Row(table.RowProps{Class: "border-b-0"}) {
@table.Cell() {
Sonntag
}
for _, menu := range plan.Menus[6] {
@table.Cell() {
{menu}
for _, menu := range plan.Menus[i] {
@table.Cell() {
{menu}
}
}
}
}