Add breadcrumb to all admin pages

I tried to use ../, and ../../ to make the routes relatives, but it
would not work well because the same page would have two URLs, one
ending with slash and another without, and the relative links would be
different on each case.
This commit is contained in:
jordi fita mas 2024-01-21 22:44:04 +01:00
parent 6ddc41e293
commit 26cc46c7b0
36 changed files with 1646 additions and 1399 deletions

964
po/ca.po

File diff suppressed because it is too large Load Diff

964
po/es.po

File diff suppressed because it is too large Load Diff

964
po/fr.po

File diff suppressed because it is too large Load Diff

View File

@ -237,7 +237,7 @@ body > header {
background-color: var(--camper--header--background-color);
}
body > header, body > nav a {
body > header, body > nav ul a {
padding: 0 3rem;
}
@ -245,24 +245,37 @@ body > nav {
border-bottom: 1px solid var(--camper--color--light-gray);
}
body > nav ul {
body > nav ul, body > nav ol {
display: flex;
list-style: none;
padding: 0;
}
body > nav li {
body > nav ul li {
flex: 1;
}
body > nav a {
text-decoration: none;
color: inherit;
}
body > nav ul a {
min-height: 8rem;
display: flex;
align-items: center;
}
body > .breadcrumb ol {
padding: .5em 3rem;
gap: .5em;
flex-wrap: wrap;
}
body > .breadcrumb li + li::before {
content: " > ";
}
body > footer {
border-top: 1px solid var(--camper--color--light-gray);
padding: .25em 3rem;

View File

@ -6,6 +6,9 @@
{{( pgettext "Bookings" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.bookingIndex*/ -}}
<a href="/admin/bookings/new">{{( pgettext "Add Booking" "action" )}}</a>

View File

@ -6,6 +6,9 @@
{{( pgettext "Payment Settings" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/booking.paymentForm*/ -}}
<form data-hx-put="/admin/booking/payment">

View File

@ -11,6 +11,13 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.slideForm*/ -}}
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
<li><a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a></li>
<li><a href="/admin/campsites/types/{{ .TypeSlug }}/slides">{{( pgettext "Campsite Type Carousel" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.slideForm*/ -}}
<form

View File

@ -6,6 +6,11 @@
{{( pgettext "Campsite Type Carousel" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
<li><a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.carouselIndex*/ -}}
<h2>{{( pgettext "Campsite Type Carousel" "title" )}}</h2>

View File

@ -11,6 +11,13 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.featureForm*/ -}}
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
<li><a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a></li>
<li><a href="/admin/campsites/types/{{ .TypeSlug }}/features">{{( pgettext "Campsite Type Features" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.featureForm*/ -}}
<form

View File

@ -6,6 +6,11 @@
{{( pgettext "Campsite Type Features" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
<li><a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.featureIndex*/ -}}
<a href="/admin/campsites/types/{{ .TypeSlug }}/features/new">{{( pgettext "Add Feature" "action" )}}</a>

View File

@ -11,6 +11,10 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="./">{{( pgettext "Campsites" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite.campsiteForm*/ -}}
<form

View File

@ -6,6 +6,9 @@
{{( pgettext "Campsites" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite.campsiteIndex*/ -}}
<a href="/admin/campsites/new">{{( pgettext "Add Campsite" "action" )}}</a>

View File

@ -11,6 +11,13 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.optionForm*/ -}}
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
<li><a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a></li>
<li><a href="/admin/campsites/types/{{ .TypeSlug }}/options">{{( pgettext "Campsite Type Options" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.optionForm*/ -}}
<form

View File

@ -6,6 +6,11 @@
{{( pgettext "Campsite Type Options" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/campsites">{{( pgettext "Campsites" "title" )}}</a></li>
<li><a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.optionIndex*/ -}}
<a href="/admin/campsites/types/{{ .TypeSlug }}/options/new">{{( pgettext "Add Option" "action" )}}</a>

View File

@ -11,6 +11,11 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="./../">{{( pgettext "Campsites" "title" )}}</a></li>
<li><a href="./">{{( pgettext "Campsite Types" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.typeForm*/ -}}
<form

View File

@ -6,6 +6,10 @@
{{( pgettext "Campsite Types" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="./">{{( pgettext "Campsites" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/campsite/types.typeIndex*/ -}}
<a href="/admin/campsites/types/new">{{( pgettext "Add Type" "action" )}}</a>

View File

@ -11,6 +11,9 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/carousel.slideForm*/ -}}
<form

View File

@ -6,6 +6,9 @@
{{( pgettext "Dashboard" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
<h2>{{( pgettext "Dashboard" "title" )}}</h2>
{{- end }}

View File

@ -6,6 +6,9 @@
{{( pgettext "Home Page" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/home.homeIndex*/ -}}
<h2>{{( pgettext "Cover" "title" )}}</h2>

View File

@ -37,7 +37,7 @@
<a href="/admin/company">{{( pgettext "Company Settings" "title" )}}</a>
</li>
<li>
<a href="/admin/booking/payment">{{( pgettext "Payment Settings" "title" )}}</a>
<a href="/admin/bookings/payment">{{( pgettext "Payment Settings" "title" )}}</a>
</li>
<li>
<a href="/admin/campsites/types">{{( pgettext "Campsite Types" "title" )}}</a>
@ -94,6 +94,15 @@
</ul>
</nav>
{{- end }}
{{ block "breadcrumb-nav" . -}}
{{ $label := (gettext "Breadcrumb")}}
<nav aria-label="{{ $label }}" class="breadcrumb">
<ol>
{{- template "breadcrumb" . }}
<li><a aria-current="page" href="">{{ template "title" . }}</a></li>
</ol>
</nav>
{{- end }}
<main id="content">
{{- template "content" . }}
</main>

View File

@ -11,6 +11,10 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/legal">{{( pgettext "Legal Texts" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/legal.legalForm*/ -}}
<form

View File

@ -6,6 +6,9 @@
{{( pgettext "Legal Texts" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/legal.legalIndex*/ -}}
<a href="/admin/legal/new">{{( pgettext "Add Legal Text" "action" )}}</a>

View File

@ -6,6 +6,9 @@
{{( pgettext "Location Settings" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/location.locationForm*/ -}}
<form data-hx-put="/admin/location">

View File

@ -6,6 +6,11 @@
{{( pgettext "Login" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "breadcrumb-nav" -}}{{""}}{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/app.loginForm */ -}}
<form id="login-form" method="post" action="/login">

View File

@ -6,6 +6,10 @@
{{( pgettext "Edit Media" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/media">{{( pgettext "Media" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/media.mediaForm*/ -}}
<form id="upload" enctype="multipart/form-data" data-hx-put="/admin/media/{{ .ID }}">

View File

@ -6,6 +6,9 @@
{{( pgettext "Media" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/media.mediaIndex*/ -}}
<h2>{{( pgettext "Media" "title" )}}</h2>

View File

@ -6,6 +6,10 @@
{{( pgettext "Upload Media" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/media">{{( pgettext "Media" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/media.uploadForm*/ -}}
<form id="mediaUpload" enctype="multipart/form-data" action="/admin/media" method="post" data-hx-boost="true">

View File

@ -6,6 +6,9 @@
{{( pgettext "Profile" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/app.profileForm*/ -}}
<form data-hx-put="/me" enctype="multipart/form-data">

View File

@ -11,6 +11,10 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/seasons">{{( pgettext "Season" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/season.seasonForm*/ -}}
<form

View File

@ -6,6 +6,9 @@
{{( pgettext "Seasons" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/season.seasonIndex*/ -}}
<a href="/admin/seasons/new">{{( pgettext "Add Season" "action" )}}</a>

View File

@ -6,6 +6,9 @@
{{( pgettext "Services Page" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/services.servicesIndex*/ -}}
<h2>{{( pgettext "Carousel" "title" )}}</h2>

View File

@ -11,6 +11,10 @@
{{ end }}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/surroundings">{{( pgettext "Surroundings" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/surroundings.highlightForm*/ -}}
<form

View File

@ -6,6 +6,9 @@
{{( pgettext "Surroundings Page" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/surroundings.highlightIndex*/ -}}
<h2>{{( pgettext "Highlights" "title" )}}</h2>

View File

@ -6,6 +6,9 @@
{{( pgettext "Tax Details" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/company.taxDetailsForm*/ -}}
<form data-hx-put="/admin/company">

View File

@ -6,6 +6,9 @@
{{( pgettext "Users" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/user.userIndex*/ -}}
<a href="/admin/users/new">{{( pgettext "Add User" "action" )}}</a>

View File

@ -6,6 +6,10 @@
{{( pgettext "Login Attempts" "title" )}}
{{- end }}
{{ define "breadcrumb" -}}
<li><a href="/admin/users">{{( pgettext "Users" "title" )}}</a></li>
{{- end }}
{{ define "content" -}}
{{- /*gotype: dev.tandem.ws/tandem/camper/pkg/user.loginAttemptIndex*/ -}}
<h2>{{( pgettext "Login Attempts" "title" )}}</h2>