rentease/internal/views/bookings_list.templ
2024-02-09 23:04:02 +01:00

45 lines
855 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() {
<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>
}
}