actix-admin/actix_admin/templates/list.html
2022-05-31 23:13:44 +02:00

27 lines
860 B
HTML

{% extends "base.html" %}
{% block content %}
<a href="create" role="button">Create</a>
<table>
<tr>
{% for model_field in view_model.fields -%}
<th>{{ model_field[0] }}</th>
{%- endfor %}
<th><!-- Edit Action --></th>
<th><!-- Delete Action --></th>
</tr>
{% for entity in entities -%}
<tr>
{% for model_field in view_model.fields -%}
<td>{{ entity.values | get(key=model_field[0]) }}</td>
{%- endfor %}
<td><a href="edit/{{ entity.values | get(key=view_model.fields[0][0]) }}" role="button">Edit</a></td>
<td>
<form method="post" action="delete/{{ entity.values | get(key=view_model.fields[0][0]) }}">
<button type="submit">Delete</button>
</form>
</td>
</tr>
{%- endfor %}
</table>
{% endblock content %}