actix-admin/templates/form_elements/selectlist.html

20 lines
820 B
HTML
Raw Normal View History

<div class="select
{% if
model.errors | get(key=model_field.field_name, default="" ) !=""
or
model.custom_errors | get(key=model_field.field_name, default="" ) !=""
%}is-danger{% endif %}"
>
2022-08-05 18:23:51 +02:00
<select name="{{ model_field.field_name }}">
{% if model_field.is_option %}
<option value=""></option>
{% else %}
<option value="" selected disabled>Select</option>
{% endif %}
{% for select_list_item in select_lists[model_field.field_name] -%}
<option {% if select_list_item[0]==model.values | get(key=model_field.field_name, default="" ) %} selected {%
endif %} value="{{ select_list_item[0] }}">{{ select_list_item[1] | split(pat="_") |
join(sep=" ") | title }}</option>
{%- endfor %}
</select>
</div>