Make submenus collapsible on mobile too

Had to change the link to the current language version of the page by a
button, to prevent following a link when trying to expand the submenu.

At first i did this with an `onclick="return false"` bullshit, but the
link was the wrong thing to do here, and it was there only to satisfy
Google et al. They will have to with the links in head.

Also made the link and buttons larger to make it easier to hit them with
finger.
This commit is contained in:
jordi fita mas 2024-02-02 22:03:40 +01:00
parent 313e5aa6c5
commit 4c4b9d8d02
5 changed files with 19 additions and 8 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-01-31 22:40+0100\n"
"POT-Creation-Date: 2024-02-02 21:57+0100\n"
"PO-Revision-Date: 2023-07-22 23:45+0200\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n"
@ -576,7 +576,6 @@ msgid "I have read and I accept %[1]sthe reservation conditions%[2]s"
msgstr "He llegit i accepto %[1]sles condicions de reserves%[2]s"
#: web/templates/public/layout.gohtml:12 web/templates/public/layout.gohtml:48
#: web/templates/public/layout.gohtml:131
msgid "Campsite Montagut"
msgstr "Càmping Montagut"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-01-31 22:40+0100\n"
"POT-Creation-Date: 2024-02-02 21:57+0100\n"
"PO-Revision-Date: 2023-07-22 23:46+0200\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n"
@ -576,7 +576,6 @@ msgid "I have read and I accept %[1]sthe reservation conditions%[2]s"
msgstr "He leído y acepto %[1]slas condiciones de reserva%[2]s"
#: web/templates/public/layout.gohtml:12 web/templates/public/layout.gohtml:48
#: web/templates/public/layout.gohtml:131
msgid "Campsite Montagut"
msgstr "Camping Montagut"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: camper\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2024-01-31 22:40+0100\n"
"POT-Creation-Date: 2024-02-02 21:57+0100\n"
"PO-Revision-Date: 2023-12-20 10:13+0100\n"
"Last-Translator: Oriol Carbonell <info@oriolcarbonell.cat>\n"
"Language-Team: French <traduc@traduc.org>\n"
@ -577,7 +577,6 @@ msgid "I have read and I accept %[1]sthe reservation conditions%[2]s"
msgstr "Jai lu et jaccepte %[1]sles conditions de réservation%[2]s"
#: web/templates/public/layout.gohtml:12 web/templates/public/layout.gohtml:48
#: web/templates/public/layout.gohtml:131
msgid "Campsite Montagut"
msgstr "Camping Montagut"

View File

@ -402,8 +402,22 @@ nav:last-of-type > ul > li:last-child {
align-items: start;
}
nav:last-of-type li {
width: 100%;
}
nav:last-of-type a, nav:last-of-type button {
width: 100%;
height: 100%;
display: block;
text-align: left;
}
.boto-reserva {
height: unset;
}
nav:last-of-type .has-submenu ul {
display: flex;
position: static;
padding-left: 2rem;
margin-top: -1rem;

View File

@ -70,7 +70,7 @@
<li class="boto-reserva"><a href="/{{ currentLocale }}/booking">{{( pgettext "Booking" "title" )}}</a></li>
{{ if .LocalizedAlternates -}}
<li class="has-submenu">{{ range .LocalizedAlternates -}}
{{ if eq .Lang currentLocale }}{{ template "alternateAnchor" . }}{{ end }}
{{ if eq .Lang currentLocale }}<button type="button">{{ .Endonym }}</button>{{ end }}
{{- end }}
<ul>
{{ range .LocalizedAlternates }}{{ if ne .Lang currentLocale -}}