44 lines
2.2 KiB
Smarty
44 lines
2.2 KiB
Smarty
|
{extends file='empty.tpl'}
|
||
|
{block name="content"}
|
||
|
<form enctype="multipart/form-data" method="post" class="container" id="item-form">
|
||
|
<input type='hidden' name='session_key' value='{$session_key|escape:'quotes'}' />
|
||
|
|
||
|
<div class="form-group row">
|
||
|
<label class="col-sm-2 col-form-label required">Nom</label>
|
||
|
<div class="col-sm-10">
|
||
|
<input name="name" class="form-control{if array_key_exists('name', $field_errors)} is-invalid{else if $submited} is-valid{/if}" type="text" value='{if array_key_exists('name', $info) && $info.name}{$info.name|escape:'quotes'}{/if}' required/>
|
||
|
{if array_key_exists('name', $field_errors)}<div class="invalid-feedback">{$field_errors['name']}</div>{/if}
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group row">
|
||
|
<label class="col-sm-2 col-form-label required">Status</label>
|
||
|
<div class="col-sm-10">
|
||
|
<select name="status" id="status" class="form-control{if array_key_exists('status', $field_errors)} is-invalid{else if $submited} is-valid{/if}" required>
|
||
|
{html_options options=$status_list selected=$info.status}
|
||
|
</select>
|
||
|
{if array_key_exists('status', $field_errors)}<div class="invalid-feedback">{$field_errors['status']}</div>{/if}
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="form-group row">
|
||
|
<label class="col-sm-2 col-form-label">Description</label>
|
||
|
<div class="col-sm-10">
|
||
|
<textarea name="description" id="description" class="form-control{if array_key_exists('description', $field_errors)} is-invalid{else if $submited} is-valid{/if}">{if array_key_exists('description', $info) && $info.description}{$info.description|escape:"htmlall"}{/if}</textarea>
|
||
|
{if array_key_exists('description', $field_errors)}<div class="form-error">{$field_errors['description']}</div>{/if}
|
||
|
</div>
|
||
|
</div>
|
||
|
|
||
|
<div class="center">
|
||
|
<a href="{if isset($item_id)}item/{$item_id}{else}search{/if}" class="btn btn-light"><i class="fa fa-undo"></i> Retour</a>
|
||
|
<button type="submit" name="submit" value="submited" class="btn btn-primary">
|
||
|
{if isset($item_id)}
|
||
|
<i class="fa fa-floppy-o" aria-hidden="true"></i> Enregistrer
|
||
|
{else}
|
||
|
<i class="fa fa-plus" aria-hidden="true"></i> Ajouter
|
||
|
{/if}
|
||
|
</button>
|
||
|
</div>
|
||
|
</form>
|
||
|
{/block}
|