rentease/internal/view/reports.templ
Ruidy ffa7f140d1
use daisyUI (#25)
* use tailwind and daisyui

* split the layout in multiple components

* remove unused code

* footer compoonent

* login form

log

* booking table

fd

* cancel style

* header

* booking form

* new booking

* line items

* line item

* report

* uniform headings
2024-11-16 19:24:26 +01:00

61 lines
2 KiB
Text

package view
import (
"github.com/rjNemo/rentease/internal/view/layout"
"strconv"
)
templ Reports(months []string, m int, year string) {
@layout.BaseLayout() {
<section class="container">
<hgroup class="flex flex-col">
<h1 class="text-3xl font-bold text-primary">Reports</h1>
<h2 class="text-lg text-muted">Generate monthly and yearly statements</h2>
</hgroup>
</section>
<section class="container mx-auto max-w-2xl">
<form hx-get="/reports/do" hx-target="#report" class="bg-base-200 p-6 rounded-lg shadow-md">
<fieldset class="space-y-4">
<legend class="text-lg font-semibold mb-4">Period</legend>
<div class="flex gap-6 mb-4">
<label for="month" class="flex items-center space-x-2 cursor-pointer">
<input type="radio" id="month" name="period" value="month" checked class="radio radio-primary"/>
<span>Monthly</span>
</label>
<label for="year" class="flex items-center space-x-2 cursor-pointer">
<input type="radio" id="year" name="period" value="year" class="radio radio-primary"/>
<span>Yearly</span>
</label>
</div>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<label for="year" class="block">
<span class="block text-sm font-medium mb-1">Year</span>
<input type="number" id="year" name="year" value={ year } class="input input-primary w-full"/>
</label>
<label for="month" class="block">
<span class="block text-sm font-medium mb-1">Month</span>
<select name="month" id="month" autofocus class="select select-primary w-full">
for i, month := range months {
<option
value={ strconv.Itoa(i + 1) }
if i+1 == m {
selected
}
>
{ month }
</option>
}
</select>
</label>
</div>
</fieldset>
<div class="mt-6 flex justify-end">
<button class="btn btn-primary">
Generate Report
</button>
</div>
</form>
</section>
<section id="report" class="container mx-auto max-w-2xl mt-8"></section>
}
}