saint-chamond: add custom template for forms of category

This commit is contained in:
Frédéric Péters 2019-02-08 10:58:15 +01:00
parent 6c12b9afc4
commit 133cc661f6
1 changed files with 48 additions and 0 deletions

View File

@ -0,0 +1,48 @@
{% load assets i18n %}
{% block cell-content %}
{% block cell-header %}
{% get_asset "wcs:category:picture:"|add:cell.category_reference as asset %}
{% if asset %}
<picture>
<img src="{% asset_url asset size="90x90" crop="center" %}" alt="">
</picture>
{% endif %}
<h2>{{ title }}</h2>
{% if description %}
<div class="intro">
{{ description|safe }}
</div>
{% endif %}
{% endblock %}
<div class="wcs-forms-of-category-{{slug}} links-list">
<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 %}"
><a href="{{ form.url }}tryauth">{{ form.title }}</a>
{% if form.description %}<div class="description">{{ form.description|safe }}</div>{% endif %}
</li>
{% endfor %}
{% if more_forms %}
<li class="more-items"><a>Plus de services</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 %}
</ul>
</div>
{% endblock %}