feat(budget): fix design and editing
All checks were successful
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 1m19s

This commit is contained in:
2026-01-04 14:28:05 +01:00
parent 209af10fd4
commit 7b95216987
3 changed files with 76 additions and 30 deletions

View File

@@ -16,12 +16,12 @@ templ page(budgets []Budget) {
}
templ editNew() {
<div class="flex flex-col">
<div class="flex flex-col h-full">
@core.Breadcrumb([]string{"Home", "Budget", "New"}, []string{"/", "/budget", "/budget/new"})
<div class="flex justify-center items-center flex-1">
<form
hx-post={ "/budget/new" }
class="grid grid-cols-4 items-center gap-4 mr-auto max-w-2xl h-full"
class="grid grid-cols-4 items-center gap-4 max-w-2xl"
>
<label for="timestamp" class="text-sm text-gray-500">Name</label>
<input
@@ -58,12 +58,12 @@ templ editNew() {
}
templ edit(budget Budget) {
<div class="flex flex-col">
<div class="flex flex-col h-full">
@core.Breadcrumb([]string{"Home", "Budget", budget.Description}, []string{"/", "/budget", "/budget/" + budget.Id.String()})
<div class="flex justify-center items-center flex-1">
<form
hx-post={ "/budget/new" }
class="grid grid-cols-4 items-center gap-4 mr-auto max-w-2xl h-full"
hx-post={ "/budget/" + budget.Id.String() }
class="grid grid-cols-4 items-center gap-4 max-w-2xl"
>
<label for="timestamp" class="text-sm text-gray-500">Name</label>
<input
@@ -81,6 +81,16 @@ templ edit(budget Budget) {
class="bg-white input col-span-3"
/>
<div class="flex gap-6 justify-end col-span-4">
<button
hx-delete={ "/budget/" + budget.Id.String() }
hx-confirm={ "Do you really want to delete '" + budget.Description + "'" }
class="col-start-4 p-2 px-4 decoration-yellow-400 decoration-[0.25rem] hover:bg-red-50 rounded-lg hover:underline flex items-center gap-2 justify-center"
>
@svg.Delete()
<span>
Delete
</span>
</button>
<a href="/budget" class="col-start-3 p-2 px-4 decoration-yellow-400 decoration-[0.25rem] hover:bg-gray-200 rounded-lg hover:underline flex items-center gap-2 justify-center">
<span class="h-4 w-4">
@svg.Cancel()
@@ -114,12 +124,12 @@ templ newItem() {
}
templ item(budget Budget) {
<a href={ "/budget/" + budget.Id.String() } class="flex flex-col w-64 h-64 p-5 rounded-lg bg-gray-50 border-1 border-gray-300 ">
<a href={ "/budget/" + budget.Id.String() } class="p-5 w-64 h-64 flex gap-10 active:bg-gray-200 flex-col justify-center items-center hover:bg-gray-100 transition-all cursor-pointer rounded-lg bg-gray-50 border-1 border-gray-300">
<span>
{ budget.Description }
</span>
<span>
{ 200 }
{ core.FormatEuros(budget.Value) }
</span>
</a>
}