Improve popup layout a bit

This commit is contained in:
Midgard 2020-05-21 02:59:29 +02:00
parent 77ceb6fa47
commit 9102750770
Signed by: midgard
GPG Key ID: 511C112F1331BBB4
3 changed files with 11 additions and 13 deletions

View File

@ -19,6 +19,7 @@ html, body {
width: 600px; width: 600px;
max-height: 400px; max-height: 400px;
overflow-y: auto; overflow-y: auto;
overflow-wrap: anywhere;
} }
.leaflet-popup-content { .leaflet-popup-content {
@ -35,6 +36,10 @@ h4 {
margin-bottom: 5px; margin-bottom: 5px;
} }
.location, .period {
margin-bottom: 3px;
}
table { table {
padding-bottom: 10px; padding-bottom: 10px;
border-spacing: 0; border-spacing: 0;
@ -116,8 +121,8 @@ table {
width: 213px; width: 213px;
} }
h3, .text { .location, .period {
max-width: 150px; margin-bottom: 8px;
} }
} }

View File

@ -35,9 +35,9 @@
<div id="resto-popup"> <div id="resto-popup">
<h3>{{name}} ({{capacity}} pl.)</h3> <h3>{{name}} ({{capacity}} pl.)</h3>
<img src="img/{{type}}.png" class="type"> <img src="img/{{type}}.png" class="type">
<div class="text">Locatie: {{address}}<br /> <div class="location">Locatie: {{address}}</div>
{{#if period.start}} <div class="period">{{#if period.start}}
{{date period.start}} tot {{date period.end}} Periode: {{date period.start}} tot {{date period.end}}
{{else}} {{else}}
Open gedurende het hele jaar. Open gedurende het hele jaar.
{{/if}} {{/if}}

View File

@ -156,14 +156,7 @@ $(document).ready(function() {
}).addTo(map); }).addTo(map);
var monthNames = ["jan.", "feb.", "mrt.", "apr.", "mei", "juni", "juli", "aug.", "sep.", "okt.", "nov.", "dec."];
Handlebars.registerHelper("date", function (ddmyyyy) { Handlebars.registerHelper("date", function (ddmyyyy) {
var parts = ddmyyyy.split("-"); return ddmyyyy.replace(/-/g, "/");
var date = parts[0];
var month = monthNames[parts[1] - 1];
var year = parts[2];
return date + " " + month + " " + year;
}) })
}); });