unshitify code
This commit is contained in:
@@ -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}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user