simplification casse et améliorations présentation
This commit is contained in:
parent
5c7e6e9b0f
commit
610af4e6a8
8 changed files with 10 additions and 14 deletions
|
|
@ -14,7 +14,7 @@
|
|||
{{/load}}
|
||||
|
||||
{{:assign key=""|uuid}}
|
||||
{{:assign cat_name=$_POST.name|trim|tolower|ucfirst}}
|
||||
{{:assign cat_name=$_POST.name|trim}}
|
||||
{{:save
|
||||
key=$key
|
||||
validate_schema="./category.schema.json"
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
{{* Traiter l'envoi du formulaire *}}
|
||||
{{#form on="save"}}
|
||||
{{* Vérifier s'il existe déjà une catégorie avec le même nom *}}
|
||||
{{#load type="category" where="$$.name = :name" :name=$_POST.name|trim|tolower|ucfirst limit=1}}
|
||||
{{#load type="category" where="$$.name = :name COLLATE U_NOCASE" :name=$_POST.name|trim limit=1}}
|
||||
{{:error message="Modification impossible car ce nom de catégorie (« %s ») existe déjà !"|args:$name|trim}}
|
||||
{{/load}}
|
||||
|
||||
|
|
@ -16,7 +16,7 @@
|
|||
key=$category.key
|
||||
validate_schema="./category.schema.json"
|
||||
type="category"
|
||||
name=$_POST.name|trim|tolower|ucfirst
|
||||
name=$_POST.name|trim
|
||||
}}
|
||||
{{:redirect force="./index.html?ok=1&msg=modification"}}
|
||||
{{/form}}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue