From 6b447fe5922705d52552734abaea69c22db49fe6 Mon Sep 17 00:00:00 2001 From: Gustavo Luigi <=> Date: Fri, 28 Jul 2023 17:56:23 -0300 Subject: [PATCH] display postal code and tags --- assets/home/script.js | 6 ++++++ content/index.blade.php | 9 +++------ content/master.blade.php | 18 +++--------------- variables.json | 23 ++++++++++------------- 4 files changed, 22 insertions(+), 34 deletions(-) diff --git a/assets/home/script.js b/assets/home/script.js index 709d52e..b1e2ff2 100644 --- a/assets/home/script.js +++ b/assets/home/script.js @@ -144,7 +144,13 @@ function initMap() { locationElement.html(locationElement.html().replace('$title', item.title)); locationElement.html(locationElement.html().replace('data-src="$image"', 'src="' + item.image + '"')); locationElement.html(locationElement.html().replace('data-href="$path"', 'href="' + item.path + '"')); + locationElement.html(locationElement.html().replace('$postalCode', (item.location.postalCode + " " + (item.location.addressLocality ?? "")).trim())); locationElement.removeClass('d-none'); + + if (item[textToSlug(tagField)]) item[textToSlug(tagField)].slice(0, 2).forEach(function (besonderheitenItem) { + locationElement.find(".tags").append(`${besonderheitenItem}`); + }); + locationElement.on('click', function () { map.setZoom(12); map.setCenter(item.marker.getPosition()); diff --git a/content/index.blade.php b/content/index.blade.php index 87f1b0d..86fcb1a 100644 --- a/content/index.blade.php +++ b/content/index.blade.php @@ -118,7 +118,6 @@
-
@@ -127,11 +126,8 @@

$title

- -

12345 Musterstadt

- - Wartung Butterfly - +

$postalCode

+
@@ -144,6 +140,7 @@ const urlBase = "{{url('/')}}"; const type = "{{$_type}}"; const locationField = "{{$_location_field}}"; + const tagField = "{{$_tags_fielda??''}}"; let filterFields = {!! json_encode($_filter_fields) !!}; diff --git a/content/master.blade.php b/content/master.blade.php index bf72a8e..25d1ed4 100644 --- a/content/master.blade.php +++ b/content/master.blade.php @@ -11,30 +11,18 @@ @yield('head') - - - @yield('content') diff --git a/variables.json b/variables.json index ab14bed..aee380f 100644 --- a/variables.json +++ b/variables.json @@ -7,13 +7,12 @@ { "name": "Primary CI Color", "type": "color", - "value" : "#e62b25" + "value": "#e62b25" }, { "name": "Secondary CI Color", "type": "color" }, - { "name": "Primary Background Color", "type": "color", @@ -23,35 +22,29 @@ "name": "Secondary Background Color", "type": "color" }, - { "name": "Primary Link Color", "type": "color", - "value" : "#e62b25" - + "value": "#e62b25" }, { "name": "Secondary Link Color", "type": "color", - "value" : "#1862A8" - + "value": "#1862A8" }, - { "name": "Title Color", "type": "color", - "value" : "#e62b25", + "value": "#e62b25", "description": "Farbe für Überschriften" - }, { "name": "Schriftart", "type": "string", - "value" : "15px/25px 'Noto Sans', Arial, sans-serif" + "value": "15px/25px 'Noto Sans', Arial, sans-serif" } ] }, - { "icon": "/font-awesome/light/map-pin.svg", "group_name": "Maps Config", @@ -73,8 +66,12 @@ "name": "Filter Fields", "type": "array", "required": true + }, + { + "name": "Tags Field", + "type": "string", + "required": true } ] } - ] \ No newline at end of file