From 6d84b8baada2206c13d26d5e9faa2dc9c2350bf0 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Mon, 25 Sep 2023 12:34:05 +0200 Subject: [PATCH] Fix campground and campsite nomenclature for SVG map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit I am using the US terms for campground and campsite, that’s why the relation is called ‘campsite’ instead of ‘pitch’, but i used the wrong terminology in the SVG map because the customer uses the UK term and call themselves campsite, so i mixed things. It is now the campground map and each individual area is a campsite, as i have been using all along. --- pkg/campsite/admin.go | 2 +- web/static/camper.css | 4 ++-- web/static/camper.js | 10 +++++----- web/templates/admin/campsite/index.gohtml | 6 +++--- web/templates/{campsite_map.svg => campground_map.svg} | 6 +++--- 5 files changed, 14 insertions(+), 14 deletions(-) rename web/templates/{campsite_map.svg => campground_map.svg} (99%) diff --git a/pkg/campsite/admin.go b/pkg/campsite/admin.go index 5e7da47..2b2db9b 100644 --- a/pkg/campsite/admin.go +++ b/pkg/campsite/admin.go @@ -129,7 +129,7 @@ type campsiteIndex struct { } func (page *campsiteIndex) MustRender(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company) { - template.MustRenderAdminFiles(w, r, user, company, page, "campsite/index.gohtml", "web/templates/campsite_map.svg") + template.MustRenderAdminFiles(w, r, user, company, page, "campsite/index.gohtml", "web/templates/campground_map.svg") } func addCampsite(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company, conn *database.Conn) { diff --git a/web/static/camper.css b/web/static/camper.css index f5825c6..cc47c7a 100644 --- a/web/static/camper.css +++ b/web/static/camper.css @@ -90,10 +90,10 @@ a.missing-translation { bottom: -1em; } -#campsite-map .guest-only { +#campground-map .guest-only { display: none; } -#campsite-map a:hover { +#campground-map a:hover { fill: #ffeeaa; } diff --git a/web/static/camper.js b/web/static/camper.js index fcced13..90f1c35 100644 --- a/web/static/camper.js +++ b/web/static/camper.js @@ -135,19 +135,19 @@ export function camperUploadForm(el) { }); } -export function setupCampsiteMap(map) { +export function setupCampgroundMap(map) { if (!map) { return; } - for (const lodge of Array.from(map.querySelectorAll('.lodge'))) { - const label = lodge.getAttribute('camper:lodge'); + for (const campsite of Array.from(map.querySelectorAll('.lodge'))) { + const label = campsite.getAttribute('camper:lodge'); if (!label) { continue; } const link = document.createElementNS('http://www.w3.org/2000/svg', 'a'); link.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '/admin/campsites/' + label); - link.append(...lodge.childNodes); - lodge.appendChild(link); + link.append(...campsite.childNodes); + campsite.appendChild(link); } } diff --git a/web/templates/admin/campsite/index.gohtml b/web/templates/admin/campsite/index.gohtml index cad9f6d..5fd7161 100644 --- a/web/templates/admin/campsite/index.gohtml +++ b/web/templates/admin/campsite/index.gohtml @@ -11,7 +11,7 @@ {{ template "settings-tabs" "campsites" }} {{( pgettext "Add Campsite" "action" )}}

{{( pgettext "Campsites" "title" )}}

- {{ template "campsite_map.svg" }} + {{ template "campground_map.svg" }} {{ if .Campsites -}} @@ -36,7 +36,7 @@ {{- end }} {{- end }} diff --git a/web/templates/campsite_map.svg b/web/templates/campground_map.svg similarity index 99% rename from web/templates/campsite_map.svg rename to web/templates/campground_map.svg index c8f3599..1785a78 100644 --- a/web/templates/campsite_map.svg +++ b/web/templates/campground_map.svg @@ -1,6 +1,6 @@ - - - + + +