Utilisation fonction :dropdown

This commit is contained in:
Jean-Christophe Engel 2025-01-31 15:34:31 +01:00
parent 64b2a37541
commit 76bd293930
2 changed files with 33 additions and 25 deletions

View File

@ -8,20 +8,24 @@
{{:include file="./_calcul_dispo.html" keep="categories,equipments"}}
{{* Sélecteur catégories *}}
<fieldset class="shortFormRight">
<legend>Filtrer par catégorie</legend>
<nav class="dropdown">
<ul>
<li><a></a></li>
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?prop=1">Toutes les catégories</a></li>
{{:assign var="options." value="" label="Toutes les catégories" href="?prop=1"}}
{{#foreach from=$categories key=key item=name}}
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
<a href="?cat_key={{$key}}&prop=1">
<strong>{{$name}}</strong>
</a>
</li>
{{:assign
var="options."
value=$key
label=$name
href="?cat_key=%s&prop=1"|args:$key
}}
{{/foreach}}
</ul>
<fieldset class="shortFormRight"">
<legend>Filtrer par catégorie</legend>
<nav>
{{:dropdown
title="Filtrer par catégorie"
options=$options
value="%s"|args:$_GET.cat_key
}}
</nav>
</fieldset>

View File

@ -8,20 +8,24 @@
{{:include file="./_calcul_dispo.html" keep="categories,equipments"}}
{{* Sélecteur catégories *}}
{{:assign var="options." value="" label="Toutes les catégories" href="?prop=0"}}
{{#foreach from=$categories key=key item=name}}
{{:assign
var="options."
value=$key
label=$name
href="?cat_key=%s&prop=0"|args:$key
}}
{{/foreach}}
<fieldset class="shortFormRight"">
<legend>Filtrer par catégorie</legend>
<nav class="dropdown">
<ul>
<li><a></a></li>
<li{{if $_GET.cat_key == null}} class="selected"{{/if}}><a href="?prop=0">Toutes les catégories</a></li>
{{#foreach from=$categories key=key item=name}}
<li {{if $_GET.cat_key == $key}}class="selected"{{/if}}>
<a href="?cat_key={{$key}}&prop=0">
<strong>{{$name}}</strong>
</a>
</li>
{{/foreach}}
</ul>
<nav>
{{:dropdown
title="Filtrer par catégorie"
options=$options
value="%s"|args:$_GET.cat_key
}}
</nav>
</fieldset>