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:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user