Only show individual campsite and “Add campsite” links to admin

Regular users do not need, or can use, those links.
This commit is contained in:
jordi fita mas 2024-04-19 17:37:28 +02:00
parent e726bde025
commit 23d16fa162
1 changed files with 11 additions and 2 deletions

View File

@ -11,7 +11,10 @@
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite.campsiteIndex*/ -}}
{{ if isAdmin -}}
<a href="/admin/campsites/new">{{( pgettext "Add Campsite" "action" )}}</a>
{{- end }}
<h2>{{( pgettext "Campsites" "title" )}}</h2>
{{ if .Campsites -}}
<form id="booking-filter">
@ -63,7 +66,13 @@
<tbody>
{{ range .Campsites -}}
<tr>
<th scope="row"><a href="/admin/campsites/{{ .Label }}">{{ .Label }}</a></th>
<th scope="row">
{{- if isAdmin -}}
<a href="/admin/campsites/{{ .Label }}">{{ .Label }}</a>
{{- else -}}
{{ .Label }}
{{- end -}}
</th>
{{ range $.Months }}
{{ range .Days }}
<td></td>