@@ -0,0 +1,32 @@
|
||||
{% macro input( id, name = '', value = '', type = "text", attributes = [] ) %}
|
||||
{% if name == '' %}
|
||||
{% set id = name %}
|
||||
{% endif %}
|
||||
<input
|
||||
type="{{ type }}"
|
||||
name="{{ name }}"
|
||||
value="{{ value }}"
|
||||
id="{{ id }}"
|
||||
class="{% if type not in [ 'radio', 'checkbox' ] %}ai1ec-form-control{% endif %}
|
||||
{{ attributes.class }}"
|
||||
{% for attribute, value in attributes %}
|
||||
{% if attribute != 'class' %}
|
||||
{{ attribute }}="{{ value }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
/>
|
||||
{% endmacro %}
|
||||
|
||||
{% macro button( id, name = '', value = '', type = "text", attributes = [] ) %}
|
||||
{% if name == '' %}
|
||||
{% set id = name %}
|
||||
{% endif %}
|
||||
<button
|
||||
type="{{ type }}"
|
||||
name="{{ name }}"
|
||||
id="{{ id }}"
|
||||
{% for attribute, value in attributes %}
|
||||
{{ attribute }}="{{ value }}"
|
||||
{% endfor %}
|
||||
>{{ value | raw }}</button>
|
||||
{% endmacro %}
|
||||
@@ -0,0 +1,37 @@
|
||||
{% macro select( id, name='', attributes = [], options = [] ) %}
|
||||
{% if name == '' %}
|
||||
{% set name = id %}
|
||||
{% endif %}
|
||||
<select
|
||||
name="{{ name }}"
|
||||
id="{{ id }}"
|
||||
class="ai1ec-form-control {{ attributes.class }}"
|
||||
{% for attribute, value in attributes %}
|
||||
{% if attribute != 'class' %}
|
||||
{{ attribute }}="{{ value }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
>
|
||||
{% for key, option in options %}
|
||||
{% if key is string %}
|
||||
<optgroup label="{{ key }}">
|
||||
{% for opt in option %}
|
||||
<option
|
||||
value="{{ opt.value }}"
|
||||
{% for attribute, value in opt.args %}
|
||||
{{ attribute }}="{{ value }}"
|
||||
{% endfor %}
|
||||
>{{ opt.text }}</option>
|
||||
{% endfor %}
|
||||
</optgroup>
|
||||
{% else %}
|
||||
<option
|
||||
value="{{ option.value | dropdown_filter }}"
|
||||
{% for attribute, value in option.args %}
|
||||
{{ attribute }}="{{ value }}"
|
||||
{% endfor %}
|
||||
>{{ option.text | dropdown_filter }}</option>
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</select>
|
||||
{% endmacro %}
|
||||
@@ -0,0 +1,15 @@
|
||||
{% macro textarea( id, name='', value = '', attributes = [] ) %}
|
||||
{% if name == '' %}
|
||||
{% set id = name %}
|
||||
{% endif %}
|
||||
<textarea
|
||||
name="{{ name }}"
|
||||
id="{{ id }}"
|
||||
class="ai1ec-form-control {{ attributes.class }}"
|
||||
{% for attribute, value in attributes %}
|
||||
{% if attribute != 'class' %}
|
||||
{{ attribute }}="{{ value }}"
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
>{{ value }}</textarea>
|
||||
{% endmacro %}
|
||||
Reference in New Issue
Block a user