16 lines
650 B
HTML
16 lines
650 B
HTML
<label for="{{ field_name }}">{{ field_label }}</label>
|
|
|
|
{% if field_type == 'select' %}
|
|
<select name="{{ field_name }}" {%- if not options %}disabled{% endif %}>
|
|
{% if options %}
|
|
<option value="">-- Select --</option>
|
|
{% for opt in options %}
|
|
<option value="{{ opt.value }}" {% if opt.value|string == value|string %}selected{% endif %}>{{ opt.label }}</option>
|
|
{% endfor %}
|
|
{% else %}
|
|
<option value="">-- No selection available --</option>
|
|
{% endif %}
|
|
</select>
|
|
{% else %}
|
|
<input type="text" name="{{ field_name }}" value="{{ value }}">
|
|
{% endif %}
|