WebApp Kacheln ergänzt

This commit is contained in:
hubobel 2026-06-20 17:45:28 +02:00
parent 16c97890e3
commit 01a145946c
3 changed files with 87 additions and 16 deletions

2
app.py
View file

@ -92,7 +92,7 @@ def index():
year=year, year=year,
week=week, week=week,
summary=summary, summary=summary,
transactions=transactions[:10], transactions=transactions,
total_income=total_income, total_income=total_income,
total_expenses=total_expenses, total_expenses=total_expenses,
total_saldo=total_saldo total_saldo=total_saldo

View file

@ -193,4 +193,58 @@ text-decoration: underline;
.transaction-table td { .transaction-table td {
padding: 6px; padding: 6px;
border-bottom: 1px solid #eee; border-bottom: 1px solid #eee;
}
.transaction-table {
width: 100%;
border-collapse: collapse;
}
.transaction-table th {
background: #ff6200;
color: white;
padding: 10px;
text-align: left;
position: sticky;
top: 0;
}
.transaction-table td {
padding: 8px;
border-bottom: 1px solid #eee;
}
.transaction-table tr:hover {
background: #f8f8f8;
}
.transaction-container {
max-height: 500px;
overflow-y: auto;
}
.transaction-container {
max-height: 500px;
overflow-y: auto;
}
.transaction-table {
width: 100%;
border-collapse: collapse;
}
.transaction-table th {
background: #ff6200;
color: white;
padding: 10px;
text-align: left;
position: sticky;
top: 0;
}
.transaction-table td {
padding: 8px;
border-bottom: 1px solid #eee;
}
.transaction-table tr:hover {
background: #f8f8f8;
} }

View file

@ -188,35 +188,52 @@
<div class="card"> <div class="card">
<h2> <h2>
Letzte Transaktionen Transaktionen in dieser Woche
</h2> </h2>
{% if transactions %} {% if transactions %}
<div class="transaction-container">
<table class="transaction-table"> <table class="transaction-table">
<thead>
{% for t in transactions[-10:]|reverse %} <tr>
<th>Datum</th>
<th>Name</th>
<th>Kategorie</th>
<th>Betrag</th>
</tr>
</thead>
<tbody>
{% for t in transactions|reverse %}
<tr> <tr>
<td> <td>
{{ t.date }} {{ t.date }}
</td> </td>
<td> <td>
{{ t.applicant_name }} {{ t.applicant_name }}
</td> </td>
<td class="{% if t.amount >= 0 %}amount-positive{% else %}amount-negative{% endif %}"> <td>
{{ "%.2f"|format(t.amount) }} € {{ t.category }}
</td> </td>
</tr> <td class="{% if t.amount >= 0 %}amount-positive{% else %}amount-negative{% endif %}">
{{ "%.2f"|format(t.amount) }} €
</td>
</tr>
{% endfor %} {% endfor %}
</tbody>
</table> </table>
</div>
{% else %} {% else %}
<p> <p>