actix-admin/templates/create_or_edit.html

30 lines
1.1 KiB
HTML
Raw Normal View History

2022-05-31 23:13:44 +02:00
{% extends "base.html" %}
{% block content %}
2022-08-05 13:32:08 +02:00
<form method="post" enctype="multipart/form-data">
2022-08-04 09:21:40 +02:00
{% for model_field in view_model.fields -%}
<div class="field">
<label class="{{ model_field | get_html_input_type }}" for="{{ model_field.field_name }}">
2022-08-04 09:21:40 +02:00
{{ model_field.field_name | split(pat="_") | join(sep=" ") | title }}
</label>
<div class="control">
2022-08-05 18:23:51 +02:00
{% if model_field.field_type == "SelectList" %}
{% include "form_elements/selectlist.html" %}
{% elif model_field.field_type == "Checkbox" %}
{% include "form_elements/checkbox.html" %}
2022-08-04 09:21:40 +02:00
{% else %}
2022-08-05 18:23:51 +02:00
{% include "form_elements/input.html" %}
2022-08-04 09:21:40 +02:00
{% endif %}
2022-08-05 18:23:51 +02:00
</div>
2022-08-04 09:21:40 +02:00
</div>
{%- endfor %}
<div class="field is-grouped">
<div class="control">
<button class="button is-link" type="submit">Save</button>
</div>
<div class="control">
<a class="button is-link is-light" href="{{ list_link }}">Cancel</a>
</div>
</div>
</form>
2022-05-31 23:13:44 +02:00
{% endblock content %}