2024-01-18 20:05:30 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Bookings" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
2024-01-21 21:44:04 +00:00
|
|
|
{{ define "breadcrumb" -}}
|
|
|
|
{{- end }}
|
|
|
|
|
2024-01-18 20:05:30 +00:00
|
|
|
{{ define "content" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.bookingIndex*/ -}}
|
|
|
|
<a href="/admin/bookings/new">{{( pgettext "Add Booking" "action" )}}</a>
|
|
|
|
<a href="/admin/bookings?format=ods">{{( pgettext "Export Bookings" "action" )}}</a>
|
2024-05-02 22:28:48 +00:00
|
|
|
{{ template "filters-toggle" }}
|
|
|
|
<form class="filters" method="GET" action="/admin/bookings"
|
|
|
|
data-hx-target="main" data-hx-boost="true" data-hx-trigger="change,search,submit"
|
|
|
|
aria-labelledby="filters-toggle"
|
|
|
|
>
|
|
|
|
{{ with .Filters }}
|
|
|
|
<fieldset>
|
|
|
|
{{ with .HolderName -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Holder name" "input" )}}<br>
|
|
|
|
<input type="text"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
{{ template "error-message" . }}
|
|
|
|
</label>
|
|
|
|
{{- end }}
|
|
|
|
{{ with .BookingStatus -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Booking status" "input" )}}<br>
|
|
|
|
<select name="{{ .Name }}"
|
|
|
|
{{ template "error-attrs" . }}
|
|
|
|
>
|
|
|
|
<option value="">{{( gettext "All statuses" )}}</option>
|
|
|
|
{{ template "list-options" . }}
|
|
|
|
</select><br>
|
|
|
|
{{ template "error-message" . }}
|
|
|
|
</label>
|
|
|
|
{{- end }}
|
|
|
|
{{ with .FromDate -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "From date" "input" )}}<br>
|
|
|
|
<input type="date"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
{{ template "error-message" . }}
|
|
|
|
</label>
|
|
|
|
{{- end }}
|
|
|
|
{{ with .ToDate -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "To date" "input" )}}<br>
|
|
|
|
<input type="date"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
{{ template "error-message" . }}
|
|
|
|
</label>
|
|
|
|
{{- end }}
|
|
|
|
</fieldset>
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Filters.HasValue }}
|
|
|
|
<a href="/admin/bookings" class="button">{{( pgettext "Reset" "action" )}}</a>
|
|
|
|
{{ end }}
|
|
|
|
</form>
|
2024-01-18 20:05:30 +00:00
|
|
|
<h2>{{( pgettext "Bookings" "title" )}}</h2>
|
2024-05-02 22:28:48 +00:00
|
|
|
{{ if .Bookings -}}
|
2024-01-18 20:05:30 +00:00
|
|
|
<table>
|
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th scope="col">{{( pgettext "Reference" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Arrival Date" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Departure Date" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Holder Name" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Status" "header" )}}</th>
|
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2024-05-02 22:28:48 +00:00
|
|
|
{{ template "results.gohtml" . }}
|
2024-01-18 20:05:30 +00:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{ else -}}
|
|
|
|
<p>{{( gettext "No booking found." )}}</p>
|
|
|
|
{{- end }}
|
|
|
|
{{- end }}
|