publik-base-theme/templates/variants/montpellier/combo/wcs/form_categories.html

87 lines
3.2 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{% load combo %}
<h2>Démarches en ligne</h2>
<p>Vous trouverez ci-dessous les démarches en ligne de Montpellier Méditerranée
Métropole mais aussi celles des différentes communes de la métropole.</p>
<!-- Agglo -->
{% for slug, categories in form_categories.items %}
{% if slug == 'agglo' %}
<div class="categories-{{ slug }} categories-list">
<h3><a href="{{ categories.base_url }}tryauth">Démarches de la Métropole</a></h3>
{% if categories.data %}
<ul>
{% for category in categories.data %}
<li class="category-{{category.slug}}" data-keywords="{{category.keywords|join:' '}}">
<a href="{{ category.url }}tryauth">{{ category.title }}</a>
<ul>
{% for form in category.forms %}
<li {% if form.authentication_required %}class="required-authentication"{% endif %}
data-keywords="{{form.keywords|join:' '}}"><a href="{{form.url}}">{{form.title}}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% endfor %}
{% if request.session.mellon_session.city.0 %}
<!-- Commune de l'utilisateur -->
{% for slug, categories in form_categories.items %}
{% with categories.variables|get:"ou-label"|default:categories.title as commune_name %}
{% if commune_name == request.session.mellon_session.city.0 %}
<div class="ma_commune categories-list">
<h3><a href="{{ categories.base_url }}tryauth">Démarches de ma commune : {{ request.session.mellon_session.city.0 }}</a></h3>
<ul class="clearfix">
{% for category in categories.data %}
<li class="category-{{category.slug}}" data-keywords="{{category.keywords|join:' '}}">
<a href="{{ category.url }}tryauth">{{ category.title }}</a>
<ul>
{% for form in category.forms %}
<li {% if form.authentication_required %}class="required-authentication"{% endif %}
data-keywords="{{form.keywords|join:' '}}"><a href="{{form.url}}">{{form.title}}</a></li>
{% endfor %}
</ul>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
{% endwith %}
{% endfor %}
{% endif %}
<div>
<h3>Les démarches dans les autres communes</h3>
<div>
<p>
<select onchange="displayCommune(this)">
<option value="" selected>Choisissez une commune...</option>
{% for categories in form_categories.values|dictsort:"title" %}
{% with categories.variables|get:"ou-label"|default:categories.title as commune_name %}
{% if commune_name != request.session.mellon_session.city.0 and categories.slug != 'agglo' %}
<option value="{{ categories.slug }}" data-url="{{ categories.base_url }}tryauth">{{ commune_name }}</option>
{% endif %}
{% endwith %}
{% endfor %}
</select>
</p>
</div>
<div>
</div>
</div>
<script type="text/javascript">
function displayCommune(select) {
var $option = $(select).find(':selected');
var url = $option.data('url');
if (url) {
window.location = url;
}
}
</script>