the_works/the_works/templates/views/werk.html

60 lines
2.1 KiB
HTML

{% extends 'base.html' %}
{% block title %}Werke{% endblock title %}
{% block head %}
<link type="text/css" rel="stylesheet" href="{{ url_for('static', filename='datatables.css') }}">
{% endblock head %}
{% block heading %}Werke{% endblock heading %}
{% block content %}
{% include "_icons.svg" %}
<div class="overflow-auto">
<table id="werk-table" class="striped">
<thead>
<tr>
<th>Titel</th>
<th>Untertitel</th>
<th>Reihe</th>
<th>Reihennummer</th>
<th>Genre(s)</th>
<th>Herausgeber:in(nen)</th>
<th>Pseudonym</th>
<th colspan="2">Aktionen</th>
</tr>
</thead>
<tbody>
{% for werk in werke %}
<tr id="werk-{{ werk['id'] }}">
<td title="Titel">{{ werk["Titel"] }}</td>
<td title="Untertitel">{{ werk["Untertitel"] }}</td>
<td title="Reihe">{{ werk["Reihe"] }}</td>
<td title="Reihennummer">{{ werk["Reihennummer"] }}</td>
<td title="Genre(s)">{{ werk["Genre_list"] | join(", ") }}</td>
<td title="Herausgeber:in(nen)">{{ werk["Herausgeber_list"] | join(", ") }}</td>
<td title="Pseudonym">{{ werk["Pseudonym"] }}</td>
<td class="action action-update" data-id="{{ werk['id'] }}"><a href="{{ url_for('werk.read', id=werk['id']) }}" title="Werk ansehen/bearbeiten"><svg viewbox="0 0 24 24"><use href="#update" /></svg></a></td>
<td id="delete-{{ werk['id'] }}" class="action"><a onclick="return confirm('Eintrag wirklich löschen?');" href="{{ url_for('werk.delete', id=werk['id']) }}" title="Werk löschen"><svg viewbox="0 0 24 24"><use href="#delete" /></svg></a></td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock content %}
{% block script %}
<script src="{{ url_for('static', filename='js/datatables.js') }}"></script>
<script src="{{ url_for('static', filename='js/init_dt.js') }}"></script>
<script>
window.onload = () => {
initDataTable("werk-table");
initCreateButton("werk-table", "Werk hinzufügen", "{{ url_for('werk.read', id=0) }}");
}
</script>
{% endblock script %}