diff --git a/src/Controller/PublicController.php b/src/Controller/PublicController.php
index af39e86..0051637 100644
--- a/src/Controller/PublicController.php
+++ b/src/Controller/PublicController.php
@@ -424,4 +424,21 @@ class PublicController extends AbstractController
'places' => $places
]);
}
+
+ #[Route('/latest_changes', name: 'app_public_latest_changes')]
+ public function latestChanges(): Response
+ {
+ // Récupérer les commerces modifiés, triés par date de modification décroissante
+ $places = $this->entityManager->getRepository(Place::class)
+ ->createQueryBuilder('p')
+ ->where('p.modified_date IS NOT NULL')
+ ->orderBy('p.modified_date', 'DESC')
+ ->setMaxResults(20)
+ ->getQuery()
+ ->getResult();
+
+ return $this->render('public/latest_changes.html.twig', [
+ 'places' => $places
+ ]);
+ }
}
\ No newline at end of file
diff --git a/templates/public/dashboard.html.twig b/templates/public/dashboard.html.twig
index b955589..8ccbb1b 100644
--- a/templates/public/dashboard.html.twig
+++ b/templates/public/dashboard.html.twig
@@ -1,6 +1,6 @@
{% extends 'base.html.twig' %}
-{% block title %}Hello PublicController!{% endblock %}
+{% block title %}Tableau de bord{% endblock %}
{% block stylesheets %}
{{ parent() }}
@@ -142,14 +142,14 @@
-
+
Zone |
- Nombre de commerces |
+ Nombre de lieux |
Complétude % |
Actions |
@@ -173,54 +173,7 @@
{{ places|length }} Lieux
- {#
-
-
-
- Nom |
- Tag |
- Email |
- Date de modification |
- Date de dernier contact |
- Date de dernière modification |
- Code postal |
- Actions |
-
-
-
-
-
- {% for place in places %}
-
-
- {% if place.name %}
- {{ place.name }}
- {% else %}
-
- {% endif %} |
- {{ place.mainTag }} |
- {{ place.email }} |
- {{ place.modifiedDate | date('Y-m-d H:i:s') }} |
- {{ place.lastContactAttemptDate | date('Y-m-d H:i:s') }} |
- {{ place.modifiedDate | date('Y-m-d H:i:s') }} |
- {{ place.zipCode }} |
-
-
-
- {% if place.name %}
-
- {% else %}
-
- {% endif %}
-
-
- |
-
- {% endfor %}
-
-
- #}
diff --git a/templates/public/latest_changes.html.twig b/templates/public/latest_changes.html.twig
new file mode 100644
index 0000000..aea736f
--- /dev/null
+++ b/templates/public/latest_changes.html.twig
@@ -0,0 +1,55 @@
+{% extends 'base.html.twig' %}
+
+{% block title %}Dernières modifications{% endblock %}
+
+{% block body %}
+ Dernières modifications
+
+
+
+
+
+ Nom |
+ Tag |
+ Email |
+ Date de modification |
+ Date de dernier contact |
+ Date de dernière modification |
+ Code postal |
+ Actions |
+
+
+
+
+ {% for place in places %}
+
+
+ {% if place.name %}
+ {{ place.name }}
+ {% else %}
+
+ {% endif %} |
+ {{ place.mainTag }} |
+ {{ place.email }} |
+ {{ place.modifiedDate | date('Y-m-d H:i:s') }} |
+ {{ place.lastContactAttemptDate | date('Y-m-d H:i:s') }} |
+ {{ place.modifiedDate | date('Y-m-d H:i:s') }} |
+ {{ place.zipCode }} |
+
+
+
+ {% if place.name %}
+
+ {% else %}
+
+ {% endif %}
+
+
+ |
+
+ {% endfor %}
+
+
+
+{% endblock %}
+
diff --git a/templates/public/nav.html.twig b/templates/public/nav.html.twig
index 5b9d233..f1992c0 100644
--- a/templates/public/nav.html.twig
+++ b/templates/public/nav.html.twig
@@ -30,6 +30,11 @@
{{ 'display.places_with_note'|trans }}
+
+
+
+ {{ 'display.latest_changes'|trans }}
+
diff --git a/translations/messages.fr.yaml b/translations/messages.fr.yaml
index 8a766da..44334b7 100644
--- a/translations/messages.fr.yaml
+++ b/translations/messages.fr.yaml
@@ -28,6 +28,7 @@ display:
closed_commerces: "Commerces fermés"
places_with_note: "Lieux avec une note"
view_stats: "Statistiques de la zone"
+ latest_changes: "Dernières modifications"
help:
cuisine: "Sélectionnez les types de cuisine que vous proposez"
values: