actix-admin/actix_admin/templates/list.html

48 lines
1.7 KiB
HTML
Raw Normal View History

2022-04-23 20:03:09 +02:00
{% extends "base.html" %}
{% block content %}
2022-06-02 18:46:24 +02:00
<a href="create" role="button">&#43;</a>
<table role="grid">
<thead>
<tr>
{% for model_field in view_model.fields -%}
<th>{{ model_field[0] }}</th>
{%- endfor %}
<th>
<!-- Edit Action -->
<!-- Delete Action -->
</th>
</tr>
</thead>
<tbody>
{% 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]) }}">&#9998;</a>
<a href="delete/{{ entity.values | get(key=view_model.fields[0][0]) }}">&#128465;</a>
<!--
<form method="post" action="delete/{{ entity.values | get(key=view_model.fields[0][0]) }}">
<button type="submit">&#128465;</button>
</form>
-->
</td>
</tr>
2022-04-27 18:22:47 +02:00
{%- endfor %}
2022-06-02 18:46:24 +02:00
</tbody>
<tfoot>
<tr>
<td colspan="{{ num_pages + 2 }}">
<div>
<a href="?page={{ page - 1 }}&entities_per_page={{ entities_per_page }}">&laquo;</a>
{% for i in range(end=num_pages) %}
<a href="?page={{ i + 1 }}&entities_per_page={{ entities_per_page }}">{{ i + 1 }}</a>
{%- endfor %}
<a href="?page={{ page + 1 }}&entities_per_page={{ entities_per_page }}">&raquo;</a>
</td>
</tr>
</tfoot>
2022-04-27 18:22:47 +02:00
</table>
2022-04-23 20:03:09 +02:00
{% endblock content %}