better design for the overview

This commit is contained in:
2026-08-28 14:17:58 +02:00
parent 9d600bc33a
commit 0ee05d55f4
+284 -57
View File
@@ -3,63 +3,290 @@
{% block title %}Meine Rechnungen{% endblock %} {% block title %}Meine Rechnungen{% endblock %}
{% block content %} {% block content %}
<section class="panel" style="display:flex; align-items:center; justify-content:space-between; gap:1rem;"> <div class="invoices-container">
<div> <!-- Header Section -->
<h1>Rechnungseinsicht</h1> <section class="invoice-header">
<p style="margin:0">Alle Rechnungen im Überblick.</p> <div class="header-text">
</div> <h1>Rechnungseinsicht</h1>
<div class="no-print"> <p>Alle Rechnungen und Dokumente auf einen Blick. Der Status zeigt dir den aktuellen Bearbeitungsstand.</p>
<button class="print-btn" type="button" onclick="printDocument()">Seite drucken</button> </div>
</div> <div class="header-actions no-print">
</section> <button class="btn btn-outline" type="button" onclick="printDocument()">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M6 9V2h12v7M6 18H4a2 2 0 01-2-2v-5a2 2 0 012-2h16a2 2 0 012 2v5a2 2 0 01-2 2h-2"/><rect x="6" y="14" width="12" height="8"/></svg>
Seite drucken
</button>
</div>
</section>
<section class="table-wrap"> <!-- Table Section -->
<table> <section class="table-card">
<thead> <div class="table-responsive">
<tr> <table class="custom-table">
<th>Rechnungsnummer</th> <thead>
<th>Zeitraum</th> <tr>
<th>Betrag</th> <th>Rechnungs-Nr.</th>
<th>Fälligkeit</th> <th>Zeitraum</th>
<th>Status</th> <th>Betrag</th>
<th>Rechnung PDF</th> <th>Fälligkeit</th>
<th>Hauptvertrag</th> <th>Status</th>
</tr> <th>Rechnung</th>
</thead> <th>Hauptvertrag</th>
<tbody> </tr>
{% for invoice in invoices %} </thead>
<tr> <tbody>
<td>{{ invoice.invoice_number }}</td> {% for invoice in invoices %}
<td>{{ invoice.period }}</td> <tr>
<td>{{ '%.2f'|format(invoice.amount_eur) }} EUR</td> <td class="font-semibold">{{ invoice.invoice_number }}</td>
<td>{{ invoice.due_date }}</td> <td>{{ invoice.period }}</td>
<td>{{ invoice.status }}</td> <td class="amount-cell">{{ '%.2f'|format(invoice.amount_eur) }}</td>
<td> <td class="text-muted">{{ invoice.due_date }}</td>
{% if invoice.pdf_path %} <td>
<a href="{{ url_for('static', filename=invoice.pdf_path) }}" target="_blank" rel="noopener">PDF ansehen</a> {% set status_lower = (invoice.status or '')|lower %}
<span class="badge {% if 'bezahlt' in status_lower %}badge-success{% elif 'prüfen' in status_lower %}badge-warning{% else %}badge-info{% endif %}">
{{ invoice.status or 'In Bearbeitung' }}
</span>
</td>
<td>
{% if invoice.pdf_path %}
<div class="action-group">
<a href="{{ url_for('static', filename=invoice.pdf_path) }}" target="_blank" rel="noopener" class="btn btn-link">
Ansehen
</a>
</div>
{% else %}
<span class="text-muted">-</span>
{% endif %}
</td>
<td>
{% if invoice.has_hauptvertrag %}
<a href="{{ url_for('view_hauptvertrag', invoice_id=invoice.id) }}" target="_blank" rel="noopener" class="btn btn-link btn-contract">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M14 2H6a2 2 0 00-2 2v16a2 2 0 002 2h12a2 2 0 002-2V8z"/><polyline points="14 2 14 8 20 8"/></svg>
Vertrag öffnen
</a>
{% else %}
<form method="post" enctype="multipart/form-data" class="upload-inline-form">
<input type="hidden" name="action" value="upload_hauptvertrag">
<input type="hidden" name="invoice_id" value="{{ invoice.id }}">
<label class="file-dropzone">
<input type="file" name="hauptvertrag_file" accept="image/*,application/pdf" required onchange="this.form.submit()">
<svg width="14" height="14" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><path d="M21 15v4a2 2 0 01-2 2H5a2 2 0 01-2-2v-4"/><polyline points="17 8 12 3 7 8"/><line x1="12" y1="3" x2="12" y2="15"/></svg>
<span>Datei wählen</span>
</label>
</form>
{% endif %}
</td>
</tr>
{% else %} {% else %}
- <tr>
{% endif %} <td colspan="7" class="empty-state">
</td> <svg width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="#a0aec0" stroke-width="1.5"><rect x="2" y="4" width="20" height="16" rx="2"/><line x1="2" y1="10" x2="22" y2="10"/></svg>
<td> <p>Noch keine Rechnungen vorhanden.</p>
{% if invoice.has_hauptvertrag %} </td>
<a href="{{ url_for('view_hauptvertrag', invoice_id=invoice.id) }}" target="_blank" rel="noopener">Hauptvertrag ansehen</a> </tr>
{% else %} {% endfor %}
<form method="post" enctype="multipart/form-data" style="display:flex; gap:0.3rem; align-items:center;"> </tbody>
<input type="hidden" name="action" value="upload_hauptvertrag"> </table>
<input type="hidden" name="invoice_id" value="{{ invoice.id }}"> </div>
<input type="file" name="hauptvertrag_file" accept="image/*,application/pdf" required style="font-size:0.8rem;"> </section>
<button type="submit" style="padding: 0.2rem 0.6rem; font-size:0.8rem;">Hochladen</button> </div>
</form>
{% endif %} <style>
</td> /* Layout & Container */
</tr> .invoices-container {
{% else %} max-width: 1200px;
<tr> margin: 0 auto;
<td colspan="7">Noch keine Rechnungen vorhanden.</td> display: flex;
</tr> flex-direction: column;
{% endfor %} gap: 1.5rem;
</tbody> font-family: inherit;
</table> }
</section>
/* Header Styling */
.invoice-header {
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 16px;
padding: 1.5rem 2rem;
display: flex;
align-items: center;
justify-content: space-between;
gap: 1rem;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
}
.header-text h1 {
margin: 0 0 0.35rem 0;
font-size: 1.5rem;
color: #1a202c;
font-weight: 700;
}
.header-text p {
margin: 0;
color: #718096;
font-size: 0.925rem;
}
/* Table Card */
.table-card {
background: #ffffff;
border: 1px solid #e2e8f0;
border-radius: 16px;
box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.03);
overflow: hidden;
}
.table-responsive {
overflow-x: auto;
}
.custom-table {
width: 100%;
border-collapse: collapse;
text-align: left;
font-size: 0.925rem;
}
.custom-table th {
background-color: #f8fafc;
color: #475569;
padding: 1rem 1.25rem;
font-weight: 600;
font-size: 0.825rem;
text-transform: uppercase;
letter-spacing: 0.05em;
border-bottom: 1px solid #e2e8f0;
}
.custom-table td {
padding: 1rem 1.25rem;
border-bottom: 1px solid #f1f5f9;
color: #334155;
vertical-align: middle;
}
.custom-table tbody tr:hover {
background-color: #f8fafc;
}
.custom-table tbody tr:last-child td {
border-bottom: none;
}
/* Typography Helpers */
.font-semibold { font-weight: 600; color: #0f172a; }
.amount-cell { font-weight: 700; color: #0f172a; }
.text-muted { color: #94a3b8; font-size: 0.875rem; }
/* Status Badges */
.badge {
display: inline-block;
padding: 0.35rem 0.75rem;
border-radius: 9999px;
font-size: 0.775rem;
font-weight: 600;
line-height: 1;
}
.badge-success { background-color: #dcfce7; color: #15803d; }
.badge-warning { background-color: #fef3c7; color: #b45309; }
.badge-info { background-color: #e0f2fe; color: #0369a1; }
/* Action Buttons & Links */
.btn {
display: inline-flex;
align-items: center;
gap: 0.4rem;
font-weight: 600;
font-size: 0.85rem;
padding: 0.5rem 1rem;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s ease;
border: none;
text-decoration: none;
}
.btn-outline {
background: #ffffff;
border: 1px solid #cbd5e1;
color: #334155;
}
.btn-outline:hover {
background: #f8fafc;
border-color: #94a3b8;
}
.btn-link {
color: #0284c7;
background: #f0f9ff;
padding: 0.4rem 0.75rem;
}
.btn-link:hover {
background: #e0f2fe;
color: #0369a1;
}
.btn-contract {
color: #0f766e;
background: #f0fdf4;
}
.btn-contract:hover {
background: #dcfce7;
color: #115e59;
}
/* Custom Inline File Upload Zone */
.upload-inline-form {
display: inline-block;
}
.file-dropzone {
display: inline-flex;
align-items: center;
gap: 0.4rem;
padding: 0.4rem 0.75rem;
background-color: #f8fafc;
border: 1.5px dashed #cbd5e1;
border-radius: 8px;
color: #475569;
font-size: 0.825rem;
font-weight: 600;
cursor: pointer;
transition: all 0.2s ease;
}
.file-dropzone:hover {
background-color: #f1f5f9;
border-color: #0284c7;
color: #0284c7;
}
.file-dropzone input[type="file"] {
display: none;
}
/* Empty State */
.empty-state {
text-align: center;
padding: 3rem 1rem !important;
}
.empty-state p {
margin: 0.5rem 0 0 0;
color: #94a3b8;
}
/* Mobile Adjustments */
@media (max-width: 768px) {
.invoice-header {
flex-direction: column;
align-items: flex-start;
}
}
</style>
{% endblock %} {% endblock %}