Bouton Ajouter catégorie sur page inventaire si aucune catégorie

This commit is contained in:
Jean-Christophe Engel 2025-01-22 14:51:03 +01:00
parent f2a9cb6af6
commit 42d85fb528
2 changed files with 10 additions and 4 deletions

View File

@ -1,7 +1,13 @@
{{* -*- brindille -*- *}}
<nav class="tabs">
{{if $current == 'inventaire'}}
<aside>
{{:linkbutton label="Ajouter un nouveau matériel" shape="plus" href="mouvements/ajouter_entree.html" target="_dialog"}}
{{if $cat == null || $cat == 0}}
{{:linkbutton label="Ajouter une catégorie" shape="plus" href="categories/add_category.html" target="_dialog"}}
{{else}}
{{:linkbutton label="Ajouter un nouveau matériel" shape="plus" href="mouvements/ajouter_entree.html" target="_dialog"}}
{{/if}}
</aside>
{{/if}}

View File

@ -8,7 +8,9 @@
{{else}}
{{:assign proprio="nonproprio"}}
{{/if}}
{{:include file="_nav.html" current="inventaire" subcurrent="%s"|args:$proprio}}
{{#load type="category" count=true assign="result"}}{{/load}}
{{:include file="_nav.html" current="inventaire" cat="%d"|args:$result.count subcurrent="%s"|args:$proprio}}
{{if $_GET.ok}}
{{if $_GET.msg == "ajout" }}
@ -22,8 +24,6 @@
<p class="block error">Modification refusée</p>
{{/if}}
{{#load type="category" count=true assign="result"}}{{/load}}
{{if $result.count == 0}}
<p class="block alert">Il n'y a aucune catégorie : vous devez en ajouter.</p>
{{else}}