2019-11-28 02:08:18 +01:00
|
|
|
{% macro input(name, label, type, opt) %}
|
2019-10-08 16:17:06 +02:00
|
|
|
<div class="form-group">
|
2019-11-28 02:08:18 +01:00
|
|
|
{% if label -%}
|
2019-10-08 16:17:06 +02:00
|
|
|
<label for="{{ name }}">{{ label }}</label>
|
2019-11-28 02:08:18 +01:00
|
|
|
{%- endif %}
|
|
|
|
<input type="{{ type|default('text') }}" class="form-control"
|
|
|
|
id="{{ name }}" name="{{ name }}"
|
|
|
|
value="{{ opt.value|default('') }}"
|
|
|
|
{%- if opt.required|default(false) %}
|
|
|
|
required="required"
|
|
|
|
{%- endif -%}
|
2019-10-08 16:17:06 +02:00
|
|
|
>
|
|
|
|
</div>
|
2019-11-28 02:08:18 +01:00
|
|
|
{%- endmacro %}
|
2019-10-08 16:17:06 +02:00
|
|
|
|
|
|
|
{% macro hidden(name, value) %}
|
|
|
|
<input type="hidden" id="{{ name }}" name="{{ name }}" value="{{ value }}">
|
2019-11-28 02:08:18 +01:00
|
|
|
{%- endmacro %}
|
2019-10-08 16:17:06 +02:00
|
|
|
|
|
|
|
{% macro submit(label) %}
|
2019-11-28 02:08:18 +01:00
|
|
|
<button type="submit" class="btn btn-primary">{{ label|default(__('form.submit')) }}</button>
|
|
|
|
{%- endmacro %}
|