diff --git a/src/Controller/PublicController.php b/src/Controller/PublicController.php index ec7cd49..a9792e4 100644 --- a/src/Controller/PublicController.php +++ b/src/Controller/PublicController.php @@ -234,6 +234,25 @@ class PublicController extends AbstractController #[Route('/request_email_to_modify/{osm_object_id}', name: 'app_public_request_email')] public function request_email($osm_object_id): Response { + if ($this->getRequest()->isMethod('POST')) { + $email = $this->getRequest()->request->get('email'); + + try { + // TODO: Implémenter l'envoi réel du mail + + $this->addFlash( + 'success', + 'Un email vous a été envoyé avec les instructions pour modifier ce lieu.' + ); + } catch (\Exception $e) { + $this->addFlash( + 'error', + 'Une erreur est survenue lors de l\'envoi de l\'email. Veuillez réessayer plus tard.' + ); + } + + return $this->redirectToRoute('app_public_index'); + } // TODO envoyer un email return $this->render('public/request_email.html.twig', [ 'controller_name' => 'PublicController', diff --git a/templates/public/edit.html.twig b/templates/public/edit.html.twig index 4c8b65f..35c7e1c 100644 --- a/templates/public/edit.html.twig +++ b/templates/public/edit.html.twig @@ -96,16 +96,18 @@ - + {{ 'display.last_modification'|trans }}: {{ commerce_overpass['@attributes'].timestamp }}, - {{ 'display.days_ago'|trans({'%days%': date(commerce_overpass['@attributes'].timestamp).diff(date()).days}) }} + + {{ 'display.days_ago'|trans({'%days%': date(commerce_overpass['@attributes'].timestamp).diff(date()).days}) }} {{ 'display.by'|trans }} {{ commerce_overpass['@attributes'].user }} + - {{ dump(commerce_overpass) }} + {# {{ dump(commerce_overpass) }} #}
@@ -142,8 +144,8 @@ container: 'map', style: 'https://api.maptiler.com/maps/basic-v2/style.json?key={{ maptiler_token }}', center: [ - {# {{ commerce_overpass['@attributes'].lon }}, #} - {# {{ commerce_overpass['@attributes'].lat }} #} + {{ commerce_overpass['@attributes'].lon }}, + {{ commerce_overpass['@attributes'].lat }} ], zoom: 14 @@ -152,8 +154,8 @@ // Ajout du marqueur new mapboxgl.Marker() .setLngLat([ - {# {{ commerce.lon }}, #} - {# {{ commerce.lat }} #} + {{ commerce_overpass['@attributes'].lon }}, + {{ commerce_overpass['@attributes'].lat }} ]) .setPopup(new mapboxgl.Popup({ offset: 25 diff --git a/templates/public/edit/ask_angela.html.twig b/templates/public/edit/ask_angela.html.twig index 73fc063..749327b 100644 --- a/templates/public/edit/ask_angela.html.twig +++ b/templates/public/edit/ask_angela.html.twig @@ -1,15 +1,18 @@ +{% block ask_angela %}
-

{{ 'display.ask_angela'|trans }}

-

{{ 'display.ask_angela_description'|trans }}

-

- {{ 'display.ask_angela_more_info'|trans }} -

- -
-
- +
+

{{ 'display.ask_angela'|trans }}

+

{{ 'display.ask_angela_description'|trans }}

+

+ {{ 'display.ask_angela_more_info'|trans }} +

- -
-
-
\ No newline at end of file +
+
+ + + +
+
+ +{% endblock %} \ No newline at end of file diff --git a/templates/public/edit/request_email.html.twig b/templates/public/edit/request_email.html.twig new file mode 100644 index 0000000..7a1518b --- /dev/null +++ b/templates/public/edit/request_email.html.twig @@ -0,0 +1,31 @@ + {% extends 'base.html.twig' %} + +{% block title %}{{ 'display.title'|trans }}{% endblock %} + +{% block stylesheets %} + {{ parent() }} + + +{% endblock %} + +{% block body %} +
+ + +
+
+
+ Demandez un email pour modifier les informations de ce lieu. +
+
+ + +
+
+
+
+{% endblock %} diff --git a/templates/public/edit/tags.html.twig b/templates/public/edit/tags.html.twig index 2dc79bd..3c65ad7 100644 --- a/templates/public/edit/tags.html.twig +++ b/templates/public/edit/tags.html.twig @@ -1,4 +1,5 @@ -{% block tags %}
+{% block tags %} +
{% for k, v in commerce_overpass.tags_converted %} @@ -13,5 +14,6 @@
{% endfor %} -
+ + {% endblock %} \ No newline at end of file diff --git a/translations/messages.en.yaml b/translations/messages.en.yaml index 2bc8f3b..dac0e71 100644 --- a/translations/messages.en.yaml +++ b/translations/messages.en.yaml @@ -46,8 +46,8 @@ display: address:street: 'Street' address:city: 'City' address:postcode: 'Postal code' - website: 'Website' contact:website: 'Contact website' + contact:mastodon: 'Contact mastodon' opening_hours: 'Opening hours' shop: 'Shop type' tourism: 'Tourism' @@ -61,4 +61,4 @@ display: ref:FR:SIRET: 'SIRET' disclaimer: title: 'Warning' - text: 'This site is a work in progress, this is a demonstration on a fictional object using OpenStreetMap API data.' \ No newline at end of file + text: 'This site is a work in progress.' \ No newline at end of file diff --git a/translations/messages.fr.yaml b/translations/messages.fr.yaml index bf4fc33..148499e 100644 --- a/translations/messages.fr.yaml +++ b/translations/messages.fr.yaml @@ -48,6 +48,7 @@ display: address:postcode: "Code postal" website: "Site web" contact:website: "Contact du Site web" + contact:mastodon: "Contact Mastodon" opening_hours: "Horaires d'ouverture" shop: "Type de commerce" tourism: "Tourisme"