actix-admin/templates/create_or_edit.html

30 lines
1.1 KiB
HTML

{% extends "base.html" %}
{% block content %}
<form method="post" enctype="multipart/form-data">
{% for model_field in view_model.fields -%}
<div class="field">
<label class="{{ model_field | get_html_input_type }}" for="{{ model_field.field_name }}">
{{ model_field.field_name | split(pat="_") | join(sep=" ") | title }}
</label>
<div class="control">
{% if model_field.field_type == "SelectList" %}
{% include "form_elements/selectlist.html" %}
{% elif model_field.field_type == "Checkbox" %}
{% include "form_elements/checkbox.html" %}
{% else %}
{% include "form_elements/input.html" %}
{% endif %}
</div>
</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>
{% endblock content %}