mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-12 13:46:51 +00:00
booking table
fd
This commit is contained in:
parent
166ea488cf
commit
73b28b1e22
4 changed files with 18 additions and 21 deletions
|
|
@ -1,15 +1,13 @@
|
||||||
package view
|
package view
|
||||||
|
|
||||||
import (
|
import "github.com/rjNemo/rentease/internal/view/layout"
|
||||||
"github.com/rjNemo/rentease/internal/view/layout"
|
|
||||||
)
|
|
||||||
|
|
||||||
templ ListBookings(bookings []*ListBookingsViewModel) {
|
templ ListBookings(bookings []*ListBookingsViewModel) {
|
||||||
@layout.BaseLayout() {
|
@layout.BaseLayout() {
|
||||||
<div class="grid">
|
<div class="flex flex-col md:flex-row justify-between items-start md:items-center gap-4 mb-4 w-full mx-4">
|
||||||
<hgroup>
|
<hgroup class="flex-shrink-0">
|
||||||
<h1>Bookings </h1>
|
<h1 class="text-3xl font-bold tracking-tight">Bookings</h1>
|
||||||
<h2>Overview of the activity</h2>
|
<h2 class="text-muted text-lg font-normal">Overview of the activity</h2>
|
||||||
</hgroup>
|
</hgroup>
|
||||||
<input
|
<input
|
||||||
type="search"
|
type="search"
|
||||||
|
|
@ -19,18 +17,19 @@ templ ListBookings(bookings []*ListBookingsViewModel) {
|
||||||
hx-target="tbody"
|
hx-target="tbody"
|
||||||
hx-swap="outerHTML"
|
hx-swap="outerHTML"
|
||||||
hx-trigger="keyup changed delay:500ms"
|
hx-trigger="keyup changed delay:500ms"
|
||||||
|
class="input input-bordered input-primary w-full md:w-96"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="overflow-auto">
|
<div class="overflow-x-auto">
|
||||||
<table class="striped">
|
<table class="table table-zebra w-full">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="col">ID</th>
|
<th scope="col" class="text-left px-4 py-2 text-primary">ID</th>
|
||||||
<th scope="col">Name</th>
|
<th scope="col" class="text-left px-4 py-2 text-primary">Name</th>
|
||||||
<th scope="col">Total (€)</th>
|
<th scope="col" class="text-right px-4 py-2 text-primary">Total (€)</th>
|
||||||
<th scope="col">From</th>
|
<th scope="col" class="text-left px-4 py-2 text-primary">From</th>
|
||||||
<th scope="col">To</th>
|
<th scope="col" class="text-left px-4 py-2 text-primary">To</th>
|
||||||
<th scope="col">Platform</th>
|
<th scope="col" class="text-left px-4 py-2 text-primary">Platform</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@BookingLines(bookings)
|
@BookingLines(bookings)
|
||||||
|
|
|
||||||
|
|
@ -8,9 +8,7 @@ package view
|
||||||
import "github.com/a-h/templ"
|
import "github.com/a-h/templ"
|
||||||
import templruntime "github.com/a-h/templ/runtime"
|
import templruntime "github.com/a-h/templ/runtime"
|
||||||
|
|
||||||
import (
|
import "github.com/rjNemo/rentease/internal/view/layout"
|
||||||
"github.com/rjNemo/rentease/internal/view/layout"
|
|
||||||
)
|
|
||||||
|
|
||||||
func ListBookings(bookings []*ListBookingsViewModel) templ.Component {
|
func ListBookings(bookings []*ListBookingsViewModel) templ.Component {
|
||||||
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
|
||||||
|
|
@ -45,7 +43,7 @@ func ListBookings(bookings []*ListBookingsViewModel) templ.Component {
|
||||||
}()
|
}()
|
||||||
}
|
}
|
||||||
ctx = templ.InitializeContext(ctx)
|
ctx = templ.InitializeContext(ctx)
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"grid\"><hgroup><h1>Bookings </h1><h2>Overview of the activity</h2></hgroup> <input type=\"search\" name=\"search\" placeholder=\"Search bookings by name…\" hx-get=\"/bookings\" hx-target=\"tbody\" hx-swap=\"outerHTML\" hx-trigger=\"keyup changed delay:500ms\"></div><div class=\"overflow-auto\"><table class=\"striped\"><thead><tr><th scope=\"col\">ID</th><th scope=\"col\">Name</th><th scope=\"col\">Total (€)</th><th scope=\"col\">From</th><th scope=\"col\">To</th><th scope=\"col\">Platform</th></tr></thead>")
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<div class=\"flex flex-col md:flex-row justify-between items-start md:items-center gap-4 mb-4 w-full mx-4\"><hgroup class=\"flex-shrink-0\"><h1 class=\"text-3xl font-bold tracking-tight\">Bookings</h1><h2 class=\"text-muted text-lg font-normal\">Overview of the activity</h2></hgroup> <input type=\"search\" name=\"search\" placeholder=\"Search bookings by name…\" hx-get=\"/bookings\" hx-target=\"tbody\" hx-swap=\"outerHTML\" hx-trigger=\"keyup changed delay:500ms\" class=\"input input-bordered input-primary w-full md:w-96\"></div><div class=\"overflow-x-auto\"><table class=\"table table-zebra w-full\"><thead><tr><th scope=\"col\" class=\"text-left px-4 py-2 text-primary\">ID</th><th scope=\"col\" class=\"text-left px-4 py-2 text-primary\">Name</th><th scope=\"col\" class=\"text-right px-4 py-2 text-primary\">Total (€)</th><th scope=\"col\" class=\"text-left px-4 py-2 text-primary\">From</th><th scope=\"col\" class=\"text-left px-4 py-2 text-primary\">To</th><th scope=\"col\" class=\"text-left px-4 py-2 text-primary\">Platform</th></tr></thead>")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -8,7 +8,7 @@ templ BaseLayout() {
|
||||||
@head()
|
@head()
|
||||||
<body hx-boost="true" style="display: flex; flex-direction: column; min-height: 100vh;">
|
<body hx-boost="true" style="display: flex; flex-direction: column; min-height: 100vh;">
|
||||||
@navbar()
|
@navbar()
|
||||||
<main class="container mx-auto flex flex-col items-center justify-center flex-grow">
|
<main class="container mx-auto flex flex-col flex-grow">
|
||||||
{ children... }
|
{ children... }
|
||||||
</main>
|
</main>
|
||||||
@footer()
|
@footer()
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ func BaseLayout() templ.Component {
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<main class=\"container mx-auto flex flex-col items-center justify-center flex-grow\">")
|
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString("<main class=\"container mx-auto flex flex-col flex-grow\">")
|
||||||
if templ_7745c5c3_Err != nil {
|
if templ_7745c5c3_Err != nil {
|
||||||
return templ_7745c5c3_Err
|
return templ_7745c5c3_Err
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue