From b31905a428503df921c72e8c71d9183ee857d022 Mon Sep 17 00:00:00 2001
From: Thomas JUND <tjund@entrouvert.com>
Date: Tue, 27 Apr 2021 16:06:29 +0200
Subject: [PATCH] templates: improve user lists of forms markup (#53234)

---
 combo/apps/wcs/templates/combo/wcs/current_drafts.html  | 4 +++-
 combo/apps/wcs/templates/combo/wcs/current_forms.html   | 5 ++++-
 combo/apps/wcs/templates/combo/wcs/user_all_forms.html  | 5 ++++-
 combo/apps/wcs/templates/combo/wcs/user_done_forms.html | 5 ++++-
 4 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/combo/apps/wcs/templates/combo/wcs/current_drafts.html b/combo/apps/wcs/templates/combo/wcs/current_drafts.html
index 9a688e8f..c787f3f7 100644
--- a/combo/apps/wcs/templates/combo/wcs/current_drafts.html
+++ b/combo/apps/wcs/templates/combo/wcs/current_drafts.html
@@ -1,6 +1,7 @@
 {% load i18n %}
 {% block cell-content %}
 <h2>{% trans 'Current Drafts' %}</h2>
+{% if drafts %}
 {% for slug, forms in current_drafts.items %}
 <div class="links-list current-drafts-{{ slug }} current-drafts list-of-forms">
   {% if forms.data %}
@@ -17,6 +18,7 @@
   {% endif %}
 </div>
 {% endfor %}
-{% if not drafts %}<div class="empty-message"><p>{% trans "There are no current drafts." %}</p></div>{% endif %}
 {% include "combo/pagination.html" %}
+{% else %}
+<div class="cell--body"><p class="empty-message">{% trans "There are no current drafts." %}</p></div>{% endif %}
 {% endblock %}
diff --git a/combo/apps/wcs/templates/combo/wcs/current_forms.html b/combo/apps/wcs/templates/combo/wcs/current_forms.html
index 90623008..a5c02bad 100644
--- a/combo/apps/wcs/templates/combo/wcs/current_forms.html
+++ b/combo/apps/wcs/templates/combo/wcs/current_forms.html
@@ -1,11 +1,14 @@
 {% load i18n %}
 {% block cell-content %}
 <h2>{% trans 'Current Forms' %}</h2>
+{% if forms %}
 {% for slug, forms in current_forms.items %}
   <div class="links-list current-forms-{{ slug }} current-forms list-of-forms">
   {% include "combo/wcs/list_of_forms.html" with forms=forms %}
   </div>
 {% endfor %}
-{% if not forms %}<div class="empty-message"><p>{% trans "There are no current forms." %}</p></div>{% endif %}
 {% include "combo/pagination.html" %}
+{% else %}
+  <div class="cell--body"><p class="empty-message">{% trans "There are no current forms." %}</p></div>
+{% endif %}
 {% endblock %}
diff --git a/combo/apps/wcs/templates/combo/wcs/user_all_forms.html b/combo/apps/wcs/templates/combo/wcs/user_all_forms.html
index 078b2902..b7253dc6 100644
--- a/combo/apps/wcs/templates/combo/wcs/user_all_forms.html
+++ b/combo/apps/wcs/templates/combo/wcs/user_all_forms.html
@@ -1,11 +1,14 @@
 {% load i18n %}
 {% block cell-content %}
 <h2>{% trans 'All Forms' %}</h2>
+{% if forms %}
 {% for slug, forms in user_forms.items %}
   <div class="links-list user-forms-{{ slug }} user-all-forms list-of-forms">
   {% include "combo/wcs/list_of_forms.html" with forms=forms %}
   </div>
 {% endfor %}
-{% if not forms %}<div class="empty-message"><p>{% trans "There are no forms." %}</p></div>{% endif %}
 {% include "combo/pagination.html" %}
+{% else %}
+	<div class="cell--body"><p class="empty-message">{% trans "There are no forms." %}</p></div>
+{% endif %}
 {% endblock %}
diff --git a/combo/apps/wcs/templates/combo/wcs/user_done_forms.html b/combo/apps/wcs/templates/combo/wcs/user_done_forms.html
index d88ae148..a4f60b92 100644
--- a/combo/apps/wcs/templates/combo/wcs/user_done_forms.html
+++ b/combo/apps/wcs/templates/combo/wcs/user_done_forms.html
@@ -1,11 +1,14 @@
 {% load i18n %}
 {% block cell-content %}
 <h2>{% trans 'Done Forms' %}</h2>
+{% if forms %}
 {% for slug, forms in user_forms.items %}
   <div class="links-list user-forms-{{ slug }} list-of-forms">
   {% include "combo/wcs/list_of_forms.html" with forms=forms %}
   </div>
 {% endfor %}
-{% if not forms %}<div class="empty-message"><p>{% trans "There are no done forms or they have been removed." %}</p></div>{% endif %}
+{% else %}
+  <div class="cell--body"><p class="empty-message">{% trans "There are no done forms or they have been removed." %}</p></div>
+{% endif %}
 {% include "combo/pagination.html" %}
 {% endblock %}
-- 
2.20.1

