From 469faf4f84ebc1d68ad0b8885d4a756476e84ba6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Laur=C3=A9line=20Gu=C3=A9rin?= <zebuline@entrouvert.com>
Date: Thu, 23 Apr 2020 10:28:43 +0200
Subject: [PATCH 17/19] toulouse-metropole: simplify custom forms_of_category &
 link-list-cell cells (#40883)

---
 .../combo/link-list-cell.html                 | 16 ++++-----
 .../combo/wcs/forms_of_category.html          | 35 +++----------------
 .../toulouse/combo/link-list-cell.html        | 16 ++++-----
 3 files changed, 17 insertions(+), 50 deletions(-)

diff --git a/templates/variants/toulouse-metropole/combo/link-list-cell.html b/templates/variants/toulouse-metropole/combo/link-list-cell.html
index a410f8e8..c7c6c6f5 100644
--- a/templates/variants/toulouse-metropole/combo/link-list-cell.html
+++ b/templates/variants/toulouse-metropole/combo/link-list-cell.html
@@ -1,11 +1,7 @@
-{% load assets i18n static %}
-{% block cell-content %}
-<div class="wcs-forms-of-category-{{slug}}">
+{% extends 'combo/link-list-cell.html' %}
+
+{% block cell-header %}{% endblock cell-header %}
+
+{% block cell-top-content %}
 <h2><span><span>{{ title }}</span></span><i class="opener"></i></h2>
-<ul>
-{% for link in links %}
-<li><a href="{{ link.url }}">{{ link.title }}</a></li>
-{% endfor %}
-</ul>
-</div>
-{% endblock %}
+{% endblock cell-top-content %}
diff --git a/templates/variants/toulouse-metropole/combo/wcs/forms_of_category.html b/templates/variants/toulouse-metropole/combo/wcs/forms_of_category.html
index 6566e710..92c98044 100644
--- a/templates/variants/toulouse-metropole/combo/wcs/forms_of_category.html
+++ b/templates/variants/toulouse-metropole/combo/wcs/forms_of_category.html
@@ -1,32 +1,7 @@
-{% load assets i18n static %}
-{% block cell-content %}
-<div class="wcs-forms-of-category-{{slug}}">
-<h2><span><span>{{ title }}</span></span><i class="opener"></i></h2>
-<ul>
-{% for form in forms %}
-<li class="{% if form.authentication_required %}required-authentication{% endif %}
-           {% for context in form.required_authentication_contexts %}required-{{context}}-authentication {% endfor %}
-           {% for keyword in form.keywords %}keyword-{{keyword|slugify}}{% endfor %}
-           {% if form.redirection %}is-redirection{% endif %}"
-    data-keywords="{% for keyword in form.keywords %}{{ keyword }}{% endfor %}"
-  ><a href="{{ form.url }}tryauth">{{ form.title }}</a>
-  {% if form.description %}<div class="description">{{ form.description|safe }}</div>{% endif %}
-  </li>
-{% endfor %}
+{% extends 'combo/wcs/forms_of_category.html' %}
 
-{% if more_forms %}
-<li class="more-items"><a>+</a></li>
-{% for form in more_forms %}
-<li style="display: none" class="additional-form {% if form.authentication_required %}required-authentication{% endif %}
-           {% for context in form.required_authentication_contexts %}required-{{context}}-authentication {% endfor %}
-           {% for keyword in form.keywords %}keyword-{{keyword|slugify}}{% endfor %}
-           {% if form.redirection %}is-redirection{% endif %}"
-  ><a href="{{ form.url }}tryauth">{{ form.title }}</a>
-  {% if form.description %}<div class="description">{{ form.description|safe }}</div>{% endif %}
-  </li>
-{% endfor %}
-{% endif %}
+{% block cell-header %}{% endblock cell-header %}
 
-</ul>
-</div>
-{% endblock %}
+{% block cell-top-content %}
+<h2><span><span>{{ title }}</span></span><i class="opener"></i></h2>
+{% endblock cell-top-content %}
diff --git a/templates/variants/toulouse/combo/link-list-cell.html b/templates/variants/toulouse/combo/link-list-cell.html
index a410f8e8..c7c6c6f5 100644
--- a/templates/variants/toulouse/combo/link-list-cell.html
+++ b/templates/variants/toulouse/combo/link-list-cell.html
@@ -1,11 +1,7 @@
-{% load assets i18n static %}
-{% block cell-content %}
-<div class="wcs-forms-of-category-{{slug}}">
+{% extends 'combo/link-list-cell.html' %}
+
+{% block cell-header %}{% endblock cell-header %}
+
+{% block cell-top-content %}
 <h2><span><span>{{ title }}</span></span><i class="opener"></i></h2>
-<ul>
-{% for link in links %}
-<li><a href="{{ link.url }}">{{ link.title }}</a></li>
-{% endfor %}
-</ul>
-</div>
-{% endblock %}
+{% endblock cell-top-content %}
-- 
2.20.1

