2024-04-28 18:28:45 +00:00
|
|
|
<!--
|
|
|
|
SPDX-FileCopyrightText: 2023 jordi fita mas <jordi@tandem.blog>
|
|
|
|
SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
-->
|
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Customers" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "breadcrumb" -}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/customer.customerIndex*/ -}}
|
|
|
|
<a href="/admin/customers/new">{{( pgettext "Add Customer" "action" )}}</a>
|
2024-05-03 16:10:16 +00:00
|
|
|
{{ template "filters-toggle" }}
|
|
|
|
<form class="filters" method="GET" action="/admin/customers"
|
|
|
|
data-hx-target="main" data-hx-boost="true" data-hx-trigger="change,search,submit"
|
|
|
|
aria-labelledby="filters-toggle"
|
|
|
|
>
|
|
|
|
{{ with .Filters }}
|
|
|
|
<fieldset>
|
|
|
|
{{ with .Name -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Name" "input" )}}<br>
|
|
|
|
<input type="text"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
{{ template "error-message" . }}
|
|
|
|
</label>
|
|
|
|
{{- end }}
|
|
|
|
{{ with .Email -}}
|
|
|
|
<label>
|
|
|
|
{{( pgettext "Email" "input" )}}<br>
|
|
|
|
<input type="text"
|
|
|
|
name="{{ .Name }}" value="{{ .Val }}" {{ template "error-attrs" . }}
|
|
|
|
><br>
|
|
|
|
{{ template "error-message" . }}
|
|
|
|
</label>
|
|
|
|
{{- end }}
|
|
|
|
</fieldset>
|
|
|
|
{{ end }}
|
|
|
|
{{ if .Filters.HasValue }}
|
|
|
|
<a href="/admin/customers" class="button">{{( pgettext "Reset" "action" )}}</a>
|
|
|
|
{{ end }}
|
|
|
|
</form>
|
2024-04-28 18:28:45 +00:00
|
|
|
<h2>{{ template "title" . }}</h2>
|
2024-05-03 16:10:16 +00:00
|
|
|
{{ if .Customers -}}
|
|
|
|
<table>
|
|
|
|
<thead>
|
2024-04-28 18:28:45 +00:00
|
|
|
<tr>
|
2024-05-03 16:10:16 +00:00
|
|
|
<th scope="col">{{( pgettext "Name" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Email" "header" )}}</th>
|
|
|
|
<th scope="col">{{( pgettext "Phone" "header" )}}</th>
|
2024-04-28 18:28:45 +00:00
|
|
|
</tr>
|
2024-05-03 16:10:16 +00:00
|
|
|
</thead>
|
|
|
|
<tbody>
|
|
|
|
{{ template "results.gohtml" . }}
|
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
{{- else }}
|
|
|
|
<p>{{( gettext "No customer found." )}}</p>
|
|
|
|
{{- end }}
|
2024-04-28 18:28:45 +00:00
|
|
|
{{- end }}
|