From 1507505ddf0984214f968e4c68967ff1f15866b8 Mon Sep 17 00:00:00 2001 From: Gustavo Luigi <=> Date: Tue, 1 Aug 2023 18:28:23 -0300 Subject: [PATCH] . --- assets/home/script.js | 18 +++++++++--------- content/contents/default.blade.php | 24 ++++-------------------- content/index.blade.php | 21 ++++++++++++--------- 3 files changed, 25 insertions(+), 38 deletions(-) diff --git a/assets/home/script.js b/assets/home/script.js index bbb8ea1..e576c5e 100644 --- a/assets/home/script.js +++ b/assets/home/script.js @@ -52,9 +52,9 @@ $(function () { function initMap() { function createInfowindowElement(item) { let infowindowElement = $("#marker-window").clone(); - infowindowElement.html(infowindowElement.html().replace('$title', item.title)); - infowindowElement.html(infowindowElement.html().replace('$description', item.description ?? '')); - infowindowElement.find(".path").attr("href", item.path); + infowindowElement.find(".js-title").text(item.title); + infowindowElement.find(".js-description").text(item.description ?? ''); + infowindowElement.find(".js-path").attr("href", item.path); infowindowElement.removeClass('d-none'); return infowindowElement[0].outerHTML; } @@ -141,18 +141,18 @@ function initMap() { $("#contents").empty(); showedItems.forEach(function (item) { let locationElement = locationElementTemplate.clone(); - locationElement.html(locationElement.html().replace('$title', item.title)); - locationElement.html(locationElement.html().replace('data-src="$image"', 'src="' + item.image + '"')); - locationElement.find(".path").attr("href", item.path); + locationElement.find(".js-title").text(item.title); + locationElement.find(".js-image").attr("src", item.image); + locationElement.find(".js-path").attr("href", item.path); let location = item[textToSlug(locationField)]; - if (location && location.postalCode) locationElement.html(locationElement.html().replace('$postalCode', (location.postalCode + " " + (location.addressLocality ?? "")).trim())); - else locationElement.find(".postal-code").hide(); + if (location && location.postalCode) locationElement.find(".js-postal-code").text((location.postalCode + " " + (location.addressLocality ?? "")).trim()); + else locationElement.find(".js-postal-code").hide(); locationElement.removeClass('d-none'); if (item[textToSlug(tagField)] && Array.isArray(item[textToSlug(tagField)])) item[textToSlug(tagField)].slice(0, 2).forEach(function (besonderheitenItem) { - locationElement.find(".tags").append(`${besonderheitenItem}`); + locationElement.find(".js-tags").append(`${besonderheitenItem}`); }); locationElement.on('click', function () { diff --git a/content/contents/default.blade.php b/content/contents/default.blade.php index eadba94..180d9a4 100644 --- a/content/contents/default.blade.php +++ b/content/contents/default.blade.php @@ -1,7 +1,6 @@ @extends('template.'.config('settings.template').'.content.master') @section('head') {{$content->title}} | {{config('settings.name')}} - @stop @section('content')
@@ -9,44 +8,29 @@
← Back
-
-

{{$content->title}}

- -
-
Bild {{$content->title}} -
-
- - {!!$content->beschreibung!!} - - + {!!$content->{$_description_fielda??''}!!}
-
- - @if($content->bilder) + @if(isset($_images_field) && $content->{$_images_field})

Bilder

- - @foreach($content->bilder as $bild) + @foreach($content->{$_images_field} as $bild)
- +
@endforeach -
@endif -