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">+</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]) }}">✎</a>
|
|
|
|
<a href="delete/{{ entity.values | get(key=view_model.fields[0][0]) }}">🗑</a>
|
|
|
|
<!--
|
|
|
|
<form method="post" action="delete/{{ entity.values | get(key=view_model.fields[0][0]) }}">
|
|
|
|
<button type="submit">🗑</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 }}">«</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 }}">»</a>
|
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</tfoot>
|
2022-04-27 18:22:47 +02:00
|
|
|
</table>
|
2022-04-23 20:03:09 +02:00
|
|
|
{% endblock content %}
|