From 9d40aa6575ad992e34dcbf703884ba9dc8247eac Mon Sep 17 00:00:00 2001 From: afornerot Date: Thu, 10 Jun 2021 11:26:55 +0200 Subject: [PATCH] =?UTF-8?q?scinder=20les=20annonces=20=C3=A0=20publier=20e?= =?UTF-8?q?n=20ligne=20archiv=C3=A9es=20(fixes=20#32602)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/Cadoles/PortalBundle/Entity/Alert.php | 2 +- .../Resources/views/Alert/list.html.twig | 202 ++++++++++++++---- 2 files changed, 161 insertions(+), 43 deletions(-) diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php index 281adc18..c285e46f 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Entity/Alert.php @@ -149,7 +149,7 @@ class Alert { $today = new \DateTime(); if (null === $this->unpublishedat) { - return true; + return false; } if ($this->unpublishedat->getTimestamp() < $today->getTimestamp()) { return true; diff --git a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig index a230a52e..ab9df0f2 100644 --- a/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig +++ b/src/ninegate-1.0/src/Cadoles/PortalBundle/Resources/views/Alert/list.html.twig @@ -11,50 +11,164 @@ Ajouter une Annonce Ajouter une Catégorie

+ +
+
+

En Attente Publication

+
-
- {% for alert in alerts %} -
- - -
- {{ alert.content|raw }} -
+
+
+ {% for alert in alerts if alert.isPending %} + + {% endfor %}
- {% endfor %} +
+
+ +
+
+

En Ligne

+
+ +
+
+ {% for alert in alerts if alert.isOnline %} + + {% endfor %} +
+
+
+ +
+
+

Archivées

+
+ +
+
+ {% for alert in alerts if alert.isArchived %} + + {% endfor %} +
+
@@ -219,7 +333,11 @@ }); } - $( "#list" ).sortable({ + if($(".alertstatut-pending").length==0) $("#listpending").hide(); + if($(".alertstatut-online").length==0) $("#listonline").hide(); + if($(".alertstatut-archived").length==0) $("#listarchived").hide(); + + $( ".list" ).sortable({ axis: "y", placeholder: "list-item placeholder", update: updateItems