eesyphp/example/templates/form.tpl

44 lines
2.2 KiB
Smarty
Raw Normal View History

{extends file='Tpl:empty.tpl'}
2020-04-18 00:51:33 +02:00
{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">{t}Name{/t}</label>
2020-04-18 00:51:33 +02:00
<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">{t}Status{/t}</label>
2020-04-18 00:51:33 +02:00
<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">{t}Description{/t}</label>
2020-04-18 00:51:33 +02:00
<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> {t}Back{/t}</a>
2020-04-18 00:51:33 +02:00
<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> {t}Save{/t}
2020-04-18 00:51:33 +02:00
{else}
<i class="fa fa-plus" aria-hidden="true"></i> {t}Add{/t}
2020-04-18 00:51:33 +02:00
{/if}
</button>
</div>
</form>
{/block}