Files
bin/finance/app/templates/_import_list.html

58 lines
2.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<table>
<thead>
<tr><th>Datei</th><th>Bank</th><th>Zeitraum</th><th>Status</th><th></th></tr>
</thead>
<tbody>
{% for s in statements %}
<tr>
<td>{{ s.filename }}</td>
<td>{{ s.bank }}</td>
<td>
{% if s.period_start and s.period_end %}
{{ s.period_start.strftime('%d.%m.%Y') }} {{ s.period_end.strftime('%d.%m.%Y') }}
{% endif %}
</td>
<td>
{% if s.status == "draft" %}
<span class="badge badge-warning">wartet auf Bestätigung</span>
{% elif s.status == "error" %}
<span class="badge badge-error">Fehler: {{ s.error_message }}</span>
{% elif s.status == "confirmed" %}
<span class="badge badge-ok">übernommen</span>
{% else %}
<span class="badge">{{ s.status }}</span>
{% endif %}
</td>
<td>
{% if s.status == "draft" %}
<details hx-get="/import/{{ s.id }}/preview-fragment"
hx-trigger="toggle once" hx-target="find .preview-slot" hx-swap="innerHTML">
<summary>Vorschau</summary>
<div class="preview-slot">Lädt…</div>
</details>
<form class="inline-form" hx-post="/api/imports/{{ s.id }}/confirm" hx-swap="none"
hx-on::after-request="if(event.detail.successful){htmx.trigger(document.getElementById('imports'), 'refresh')}">
<button type="submit">Übernehmen</button>
</form>
<form class="inline-form" hx-delete="/api/imports/{{ s.id }}" hx-swap="none"
hx-confirm="Import „{{ s.filename }}“ wirklich verwerfen?"
hx-on::after-request="if(event.detail.successful){htmx.trigger(document.getElementById('imports'), 'refresh')}">
<button type="submit">Verwerfen</button>
</form>
{% elif s.status == "confirmed" %}
<span class="muted">Bestätigt — Buchungen übernommen</span>
{% else %}
<form class="inline-form" hx-delete="/api/imports/{{ s.id }}" hx-swap="none"
hx-confirm="Import „{{ s.filename }}“ wirklich verwerfen?"
hx-on::after-request="if(event.detail.successful){htmx.trigger(document.getElementById('imports'), 'refresh')}">
<button type="submit">Verwerfen</button>
</form>
{% endif %}
</td>
</tr>
{% else %}
<tr><td colspan="5">Noch keine Imports vorhanden.</td></tr>
{% endfor %}
</tbody>
</table>