Fix campground and campsite nomenclature for SVG map
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.
This commit is contained in:
parent
233aacc2de
commit
6d84b8baad
|
@ -129,7 +129,7 @@ type campsiteIndex struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
func (page *campsiteIndex) MustRender(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company) {
|
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) {
|
func addCampsite(w http.ResponseWriter, r *http.Request, user *auth.User, company *auth.Company, conn *database.Conn) {
|
||||||
|
|
|
@ -90,10 +90,10 @@ a.missing-translation {
|
||||||
bottom: -1em;
|
bottom: -1em;
|
||||||
}
|
}
|
||||||
|
|
||||||
#campsite-map .guest-only {
|
#campground-map .guest-only {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
#campsite-map a:hover {
|
#campground-map a:hover {
|
||||||
fill: #ffeeaa;
|
fill: #ffeeaa;
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,19 +135,19 @@ export function camperUploadForm(el) {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setupCampsiteMap(map) {
|
export function setupCampgroundMap(map) {
|
||||||
if (!map) {
|
if (!map) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
for (const lodge of Array.from(map.querySelectorAll('.lodge'))) {
|
for (const campsite of Array.from(map.querySelectorAll('.lodge'))) {
|
||||||
const label = lodge.getAttribute('camper:lodge');
|
const label = campsite.getAttribute('camper:lodge');
|
||||||
if (!label) {
|
if (!label) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
const link = document.createElementNS('http://www.w3.org/2000/svg', 'a');
|
||||||
link.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '/admin/campsites/' + label);
|
link.setAttributeNS('http://www.w3.org/1999/xlink', 'href', '/admin/campsites/' + label);
|
||||||
link.append(...lodge.childNodes);
|
link.append(...campsite.childNodes);
|
||||||
lodge.appendChild(link);
|
campsite.appendChild(link);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,7 @@
|
||||||
{{ template "settings-tabs" "campsites" }}
|
{{ template "settings-tabs" "campsites" }}
|
||||||
<a href="/admin/campsites/new">{{( pgettext "Add Campsite" "action" )}}</a>
|
<a href="/admin/campsites/new">{{( pgettext "Add Campsite" "action" )}}</a>
|
||||||
<h2>{{( pgettext "Campsites" "title" )}}</h2>
|
<h2>{{( pgettext "Campsites" "title" )}}</h2>
|
||||||
{{ template "campsite_map.svg" }}
|
{{ template "campground_map.svg" }}
|
||||||
{{ if .Campsites -}}
|
{{ if .Campsites -}}
|
||||||
<table>
|
<table>
|
||||||
<thead>
|
<thead>
|
||||||
|
@ -36,7 +36,7 @@
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
||||||
<script type="module">
|
<script type="module">
|
||||||
import {setupCampsiteMap} from "/static/camper.js";
|
import {setupCampgroundMap} from "/static/camper.js";
|
||||||
setupCampsiteMap(document.getElementById('campsite-map'));
|
setupCampgroundMap(document.getElementById('campground-map'));
|
||||||
</script>
|
</script>
|
||||||
{{- end }}
|
{{- end }}
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<svg id="campsite-map" viewBox="0 0 1058 1085" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:camper="https://dev.tandem.ws/tandem/camper#ns" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;">
|
<svg id="campground-map" viewBox="0 0 1058 1085" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:camper="https://dev.tandem.ws/tandem/camper#ns" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:10;">
|
||||||
<g id="campsite" transform="matrix(0.912267,0,0,0.884168,-312.538,-285.474)">
|
<g id="campground" transform="matrix(0.912267,0,0,0.884168,-312.538,-285.474)">
|
||||||
<g id="lodges" transform="matrix(1.09617,0,0,1.13101,355.064,337.177)" style="fill:rgb(239,237,236);fill-rule:nonzero;stroke:rgb(82,84,83);stroke-width:1px;font-family:'MabryPro-Regular', 'Mabry Pro', sans-serif;font-size:12px;">
|
<g id="campsites" transform="matrix(1.09617,0,0,1.13101,355.064,337.177)" style="fill:rgb(239,237,236);fill-rule:nonzero;stroke:rgb(82,84,83);stroke-width:1px;font-family:'MabryPro-Regular', 'Mabry Pro', sans-serif;font-size:12px;">
|
||||||
<g transform="matrix(1,0,0,1,0.5985,1025.35)">
|
<g transform="matrix(1,0,0,1,0.5985,1025.35)">
|
||||||
<path d="M0,-990.992L27.407,-1007.54L87.281,-978.762L159.705,-932.002L338.303,-990.273L389.084,-988.834L385.335,-1019.77L443.575,-1024.8L443.575,-1000.34L469.044,-991.711L463.726,-975.128L452.561,-920.171L447.356,-906.587L445.816,-886.421L443.263,-848.083L443.263,-836.84L450.361,-836.84L456.623,-801.618L448.016,-731.276L447.781,-703.373L431.134,-680.864L402.997,-677.112L403.7,-631.859L415.575,-566.087L427.066,-530.191L442.301,-507.564L456.129,-497.587L489.963,-495.753L729.842,-501.925L822.236,-501.057L827.758,-539.051L904.676,-553.793L1025.39,-528.26L990.141,-411.331L974.982,-368.892L964.047,-324.723L967.932,-319.543L967.069,-315.947L974.982,-303.466L984.244,-282.064L992.751,-273.051L1004.8,-239.436L958.724,-153.66C958.724,-153.66 958.015,-201.191 951.635,-231.656C945.255,-262.12 935.331,-277.903 910.519,-277.101C885.708,-276.298 766.941,-277.101 766.941,-277.101C766.941,-277.101 748.888,-269.02 748.181,-263.444L657.481,-250.605L534.177,-248.641L493.47,-234.396L461.99,-244.22L417.115,-228.502C417.115,-228.502 413.301,-216.688 389.755,-194.843L361.297,-182.822L307.266,-144.018L263.551,-123.437L209.282,-72.445L164.289,-50.276L157.552,-42.632L195.815,17.758L173.213,33.811L130.54,-26.579L104.106,-5.175L76.266,-0.588L55.403,-1.353L24.284,-17.406L21.991,-41.103L10.524,-66.33L27.12,-77.215C27.12,-77.215 9.266,-90.704 8.869,-112.128C8.473,-133.552 18.788,-189.096 15.614,-219.645C12.44,-250.195 22.755,-351.364 22.755,-351.364C22.755,-351.364 21.962,-372.724 52.511,-423.44L71.732,-471.775L84.25,-533.027C84.25,-533.027 94.169,-564.785 64.81,-599.414C35.451,-634.043 27.407,-643.565 27.407,-643.565C27.407,-643.565 16.408,-663.082 21.962,-681.889C27.516,-700.696 42.989,-759.553 42.989,-759.553L38.228,-789.568L42.196,-791.239L36.458,-815.354C36.458,-815.354 40.609,-826.463 34.261,-866.534C27.913,-906.605 34.043,-915.73 27.407,-920.491C27.407,-920.491 27.516,-923.262 21.962,-928.423C21.962,-928.423 16.011,-936.361 15.614,-940.328C15.217,-944.296 0,-990.992 0,-990.992Z" style="fill:rgb(233,244,241);fill-rule:nonzero;stroke:none"/>
|
<path d="M0,-990.992L27.407,-1007.54L87.281,-978.762L159.705,-932.002L338.303,-990.273L389.084,-988.834L385.335,-1019.77L443.575,-1024.8L443.575,-1000.34L469.044,-991.711L463.726,-975.128L452.561,-920.171L447.356,-906.587L445.816,-886.421L443.263,-848.083L443.263,-836.84L450.361,-836.84L456.623,-801.618L448.016,-731.276L447.781,-703.373L431.134,-680.864L402.997,-677.112L403.7,-631.859L415.575,-566.087L427.066,-530.191L442.301,-507.564L456.129,-497.587L489.963,-495.753L729.842,-501.925L822.236,-501.057L827.758,-539.051L904.676,-553.793L1025.39,-528.26L990.141,-411.331L974.982,-368.892L964.047,-324.723L967.932,-319.543L967.069,-315.947L974.982,-303.466L984.244,-282.064L992.751,-273.051L1004.8,-239.436L958.724,-153.66C958.724,-153.66 958.015,-201.191 951.635,-231.656C945.255,-262.12 935.331,-277.903 910.519,-277.101C885.708,-276.298 766.941,-277.101 766.941,-277.101C766.941,-277.101 748.888,-269.02 748.181,-263.444L657.481,-250.605L534.177,-248.641L493.47,-234.396L461.99,-244.22L417.115,-228.502C417.115,-228.502 413.301,-216.688 389.755,-194.843L361.297,-182.822L307.266,-144.018L263.551,-123.437L209.282,-72.445L164.289,-50.276L157.552,-42.632L195.815,17.758L173.213,33.811L130.54,-26.579L104.106,-5.175L76.266,-0.588L55.403,-1.353L24.284,-17.406L21.991,-41.103L10.524,-66.33L27.12,-77.215C27.12,-77.215 9.266,-90.704 8.869,-112.128C8.473,-133.552 18.788,-189.096 15.614,-219.645C12.44,-250.195 22.755,-351.364 22.755,-351.364C22.755,-351.364 21.962,-372.724 52.511,-423.44L71.732,-471.775L84.25,-533.027C84.25,-533.027 94.169,-564.785 64.81,-599.414C35.451,-634.043 27.407,-643.565 27.407,-643.565C27.407,-643.565 16.408,-663.082 21.962,-681.889C27.516,-700.696 42.989,-759.553 42.989,-759.553L38.228,-789.568L42.196,-791.239L36.458,-815.354C36.458,-815.354 40.609,-826.463 34.261,-866.534C27.913,-906.605 34.043,-915.73 27.407,-920.491C27.407,-920.491 27.516,-923.262 21.962,-928.423C21.962,-928.423 16.011,-936.361 15.614,-940.328C15.217,-944.296 0,-990.992 0,-990.992Z" style="fill:rgb(233,244,241);fill-rule:nonzero;stroke:none"/>
|
||||||
</g>
|
</g>
|
Before Width: | Height: | Size: 245 KiB After Width: | Height: | Size: 245 KiB |
Loading…
Reference in New Issue