actix-admin/actix_admin/templates/list.html

26 lines
901 B
HTML
Raw Normal View History

2022-04-23 20:03:09 +02:00
{% extends "base.html" %}
{% block content %}
2022-05-01 23:30:20 +02:00
<a href="create" role="button">Create</a>
2022-04-27 18:22:47 +02:00
<table>
<tr>
2022-05-01 23:30:20 +02:00
{% for model_field in view_model.fields -%}
2022-04-27 18:22:47 +02:00
<th>{{ model_field[0] }}</th>
{%- endfor %}
2022-05-27 14:10:35 +02:00
<th><!-- Delete Action --></th>
2022-04-27 18:22:47 +02:00
</tr>
2022-05-22 22:00:33 +02:00
{% for entity in entities -%}
2022-04-27 18:22:47 +02:00
<tr>
2022-05-22 22:00:33 +02:00
{% for model_field in view_model.fields -%}
<td>{{ entity.values | get(key=model_field[0]) }}</td>
{%- endfor %}
2022-05-27 14:10:35 +02:00
<td>
<form method="post" action="delete/{{ entity.values | get(key=view_model.fields[0][0]) }}">
<input type="hidden" id="{{ view_model.fields[0][0] }}" name="{{ view_model.fields[0][0] }}" value="{{ entity.values | get(key=view_model.fields[0][0]) }}">
<button type="submit" class="outline">Delete</button>
</form>
</td>
2022-04-27 18:22:47 +02:00
</tr>
2022-05-22 22:00:33 +02:00
{%- endfor %}
2022-04-27 18:22:47 +02:00
</table>
2022-04-23 20:03:09 +02:00
{% endblock content %}