mirror of
https://github.com/rjNemo/rentease.git
synced 2026-06-11 21:26:50 +00:00
40 lines
892 B
Text
40 lines
892 B
Text
package views
|
|
|
|
import "github.com/rjNemo/rentease/internal/domains/booking"
|
|
import "strconv"
|
|
import "fmt"
|
|
|
|
templ ListBookings(bookings []*booking.Booking) {
|
|
@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={ templ.SafeURL(fmt.Sprintf("/bookings/%d", b.Id)) }>
|
|
{ strconv.Itoa(b.Id) }
|
|
</a>
|
|
</th>
|
|
<td>{ b.Name }</td>
|
|
<td></td>
|
|
<td>{ b.From.Format("2006-01-02") }</td>
|
|
<td>{ b.To.Format("2006-01-02") }</td>
|
|
<td>{ b.Platform }</td>
|
|
</tr>
|
|
}
|
|
</tbody>
|
|
</table>
|
|
</figure>
|
|
}
|
|
}
|