rentease/internal/views/bookings_list.templ
2024-02-11 21:41:52 +01:00

49 lines
937 B
Text

package views
type ListBookingsViewModel struct {
Id string
Url templ.SafeURL
From string
To string
Name string
Platform string
}
templ ListBookings(bookings []*ListBookingsViewModel) {
@BaseLayout() {
<hgroup>
<h1>Bookings </h1>
<h2>Overview of the activity</h2>
</hgroup>
<figure>
<table role="grid">
<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>
<tbody>
for _, b := range bookings {
<tr>
<th scope="row">
<a href={ b.Url }>
{ b.Id }
</a>
</th>
<td>{ b.Name }</td>
<td></td>
<td>{ b.From }</td>
<td>{ b.To }</td>
<td>{ b.Platform }</td>
</tr>
}
</tbody>
</table>
</figure>
}
}