mirror of
https://forge.chapril.org/tykayn/osm-commerces
synced 2025-06-20 01:44:42 +02:00
custom link to edit
This commit is contained in:
parent
cb240dd169
commit
fd72a1cedc
3 changed files with 19 additions and 10 deletions
2
.env
2
.env
|
@ -42,3 +42,5 @@ MAILER_DSN=null://null
|
|||
#DEBUG=0
|
||||
|
||||
APP_OSM_BEARER=CHANGE_IT
|
||||
MAPBOX_TOKEN=
|
||||
MAPTILER_TOKEN=
|
||||
|
|
|
@ -14,8 +14,6 @@ use Symfony\Component\HttpFoundation\Request;
|
|||
|
||||
class PublicController extends AbstractController
|
||||
{
|
||||
private $mapbox_token = 'BVM2NRJuzQunWvXbTnzg';
|
||||
private $maptiler_token = 'BVM2NRJuzQunWvXbTnzg';
|
||||
|
||||
public function __construct(
|
||||
private EntityManagerInterface $entityManager,
|
||||
|
@ -32,8 +30,8 @@ class PublicController extends AbstractController
|
|||
return $this->render('public/index.html.twig', [
|
||||
'controller_name' => 'PublicController',
|
||||
'commerce' => $commerce,
|
||||
'mapbox_token' => $this->mapbox_token,
|
||||
'maptiler_token' => $this->maptiler_token,
|
||||
'mapbox_token' => $_ENV['MAPBOX_TOKEN'],
|
||||
'maptiler_token' => $_ENV['MAPTILER_TOKEN'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -48,6 +46,8 @@ class PublicController extends AbstractController
|
|||
return $this->render('public/edit.html.twig', [
|
||||
'commerce' => $commerce,
|
||||
'name' => $name,
|
||||
"mapbox_token" => $_ENV['MAPBOX_TOKEN'],
|
||||
"maptiler_token" => $_ENV['MAPTILER_TOKEN'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
@ -171,8 +171,8 @@ class PublicController extends AbstractController
|
|||
'controller_name' => 'PublicController',
|
||||
'commerce' => $commerce,
|
||||
'status' => $status,
|
||||
'mapbox_token' => $this->mapbox_token,
|
||||
'maptiler_token' => $this->maptiler_token,
|
||||
'mapbox_token' => $_ENV['MAPBOX_TOKEN'],
|
||||
'maptiler_token' => $_ENV['MAPTILER_TOKEN'],
|
||||
]);
|
||||
}
|
||||
|
||||
|
|
|
@ -63,6 +63,11 @@
|
|||
<a class="btn btn-info" href="{{ path('app_public_index') }}">{{ 'display.contact_humans'|trans }}</a>
|
||||
</div>
|
||||
|
||||
|
||||
{% if commerce.tags_converted.image %}
|
||||
<img src="{{ commerce.tags_converted.image }}" alt="Image du lieu" class="img-fluid mb-3">
|
||||
{% endif %}
|
||||
|
||||
<h2>{{ 'display.tags'|trans }}</h2>
|
||||
<fieldset>
|
||||
{% for attributes in commerce.tag %}
|
||||
|
@ -98,6 +103,8 @@
|
|||
<div class="lien-OpenStreetMap">
|
||||
<a href="https://www.openstreetmap.org/node/{{ commerce['@attributes'].id }}" target="_blank">{{ 'display.view_on_osm'|trans }}</a>
|
||||
</div>
|
||||
|
||||
{{ dump(commerce) }}
|
||||
</span>
|
||||
|
||||
<div class="disclaimer p-3">
|
||||
|
@ -126,9 +133,9 @@
|
|||
|
||||
{% block javascripts %}
|
||||
{{ parent() }}
|
||||
{# <script src='https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.js'></script> #}
|
||||
{# <script>
|
||||
{% if commerce is not empty %}
|
||||
<script src='https://api.mapbox.com/mapbox-gl-js/v2.15.0/mapbox-gl.js'></script>
|
||||
{# <script>
|
||||
{% if commerce is not empty and mapbox_token is not empty and maptiler_token is not empty %}
|
||||
mapboxgl.accessToken = '{{ mapbox_token }}';
|
||||
map = new mapboxgl.Map({
|
||||
container: 'map',
|
||||
|
@ -146,6 +153,6 @@
|
|||
}).setHTML('<h1>{{ commerce.tags_converted.name }}</h1>'))
|
||||
.addTo(map);
|
||||
{% endif %}
|
||||
</script> #}
|
||||
</script> #}
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue