Fix: Corrected JavaScript syntax in project-map Blade template (selectFeature and window.openViewer calls). Feat: Enhanced templates page with clearer button text and explanatory text for generic template creation.

This commit is contained in:
2026-05-11 23:27:14 +02:00
parent 7959d44211
commit 53df28068c
2 changed files with 7 additions and 4 deletions
@@ -252,7 +252,7 @@
];
@endphp
(function() {
const data = !!json_encode($fc)!!;
const data = @json($fc);
if (data && data.features && data.features.length > 0) {
const phaseLayer = L.geoJSON(data, {
style: { color: '{{ $phase->color }}', weight: 3, opacity: 0.8, fillOpacity: 0.3 },
@@ -262,7 +262,7 @@
let content = `<b>${props.name || 'Elemento'}</b><br>
{{ __("Progress") }}: ${props.progress || 0}%<br>
{{ __("Responsible") }}: ${props.responsible || '-'}<br>
<button class="btn btn-xs btn-primary mt-1" onclick="selectFeature(${featId})">✏️ Editar</button>`;
<button class="btn btn-xs btn-primary mt-1" onclick="selectFeature(' + featId + ')">✏️ Editar</button>`;
layer.bindPopup(content);
layer.on('click', function() { selectFeature(featId); });
}
@@ -348,7 +348,7 @@
m.forEach(marker => {
const popupContent = `<b>${marker.name}</b><br>
<img src="${marker.image_url}" class="max-w-[200px] max-h-[150px] rounded cursor-pointer"
onclick="window.openViewer('${marker.image_url}', '${marker.image_name}')" />`;
onclick="window.openViewer(' + marker.image_url + ', ' + marker.image_name + ')" />`;
L.marker([marker.lat, marker.lng], { icon: photoIcon })
.bindPopup(popupContent)
.addTo(imageMarkersLayer);