This commit is contained in:
+124
-155
@@ -1,161 +1,150 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block title %}Mahnungen & Überfällige Ausleihen{% endblock %}
|
{% block title %}Mahnungsübersicht - {{ APP_VERSION }}{% endblock %}
|
||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<html lang="de">
|
|
||||||
<head>
|
|
||||||
<meta charset="UTF-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
||||||
|
|
||||||
<!-- ==========================================
|
|
||||||
CSS STYLES
|
|
||||||
========================================== -->
|
|
||||||
<style>
|
<style>
|
||||||
:root {
|
.mahnungen-shell {
|
||||||
--bg-color: #f4f7f6;
|
max-width: 1180px;
|
||||||
--text-color: #333;
|
margin: 0 auto;
|
||||||
--primary: #4a90e2;
|
|
||||||
--danger: #dc3545;
|
|
||||||
--warning: #ffc107;
|
|
||||||
--info: #0dcaf0;
|
|
||||||
--success: #198754;
|
|
||||||
--border-color: #dee2e6;
|
|
||||||
}
|
|
||||||
|
|
||||||
body {
|
|
||||||
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
|
|
||||||
background-color: var(--bg-color);
|
|
||||||
color: var(--text-color);
|
|
||||||
margin: 0;
|
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.container {
|
.mahnungen-head {
|
||||||
width: 100%;
|
background: linear-gradient(135deg, #ffffff 0%, #f7f9fc 100%);
|
||||||
max-width: 1200px;
|
border: 1px solid #dbe4ee;
|
||||||
margin: 0 auto;
|
border-radius: 16px;
|
||||||
}
|
padding: 18px 20px;
|
||||||
|
margin-bottom: 20px;
|
||||||
.header-bar {
|
box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
|
||||||
display: flex;
|
display: flex;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
margin-bottom: 20px;
|
flex-wrap: wrap;
|
||||||
|
gap: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.header-bar h2 {
|
.mahnungen-head h1 {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
color: #2c3e50;
|
font-size: 1.55rem;
|
||||||
|
color: #1e293b;
|
||||||
|
}
|
||||||
|
|
||||||
|
.head-actions {
|
||||||
|
display: flex;
|
||||||
|
gap: 10px;
|
||||||
|
flex-wrap: wrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
.search-box-wrapper {
|
||||||
|
margin-bottom: 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Suchfeld Styling */
|
|
||||||
.search-box {
|
.search-box {
|
||||||
padding: 10px;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
max-width: 300px;
|
max-width: 360px;
|
||||||
border: 1px solid var(--border-color);
|
padding: 10px 14px;
|
||||||
border-radius: 4px;
|
border: 1px solid #cbd5e1;
|
||||||
font-size: 1rem;
|
|
||||||
margin-bottom: 20px;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Card & Table Styling */
|
|
||||||
.card {
|
|
||||||
background-color: #fff;
|
|
||||||
border-radius: 8px;
|
border-radius: 8px;
|
||||||
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
|
font-size: 0.95rem;
|
||||||
padding: 20px;
|
outline: none;
|
||||||
overflow-x: auto;
|
transition: border-color 0.2s, box-shadow 0.2s;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table {
|
.search-box:focus {
|
||||||
|
border-color: #3b82f6;
|
||||||
|
box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mahnungen-card {
|
||||||
|
background: var(--ui-surface, #ffffff);
|
||||||
|
border: 1px solid #e2e8f0;
|
||||||
|
border-radius: 16px;
|
||||||
|
padding: 18px;
|
||||||
|
box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
|
||||||
|
}
|
||||||
|
|
||||||
|
.mahnungen-table {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
border-collapse: collapse;
|
border-collapse: collapse;
|
||||||
|
}
|
||||||
|
|
||||||
|
.mahnungen-table th,
|
||||||
|
.mahnungen-table td {
|
||||||
|
padding: 12px 10px;
|
||||||
|
border-bottom: 1px solid #edf2f7;
|
||||||
|
vertical-align: middle;
|
||||||
text-align: left;
|
text-align: left;
|
||||||
}
|
}
|
||||||
|
|
||||||
.table th, .table td {
|
.mahnungen-table th {
|
||||||
padding: 12px 15px;
|
font-size: 0.83rem;
|
||||||
border-bottom: 1px solid var(--border-color);
|
text-transform: uppercase;
|
||||||
|
letter-spacing: 0.04em;
|
||||||
|
color: #64748b;
|
||||||
|
background: var(--ui-surface-soft, #f8fafc);
|
||||||
}
|
}
|
||||||
|
|
||||||
.table th {
|
.mahnungen-table tr:hover td {
|
||||||
background-color: #f8f9fa;
|
background: #fbfdff;
|
||||||
font-weight: 600;
|
|
||||||
color: #495057;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.table tbody tr:hover {
|
.badge-pill {
|
||||||
background-color: #f8f9fa;
|
display: inline-flex;
|
||||||
|
align-items: center;
|
||||||
|
padding: 4px 10px;
|
||||||
|
border-radius: 999px;
|
||||||
|
font-size: 0.78rem;
|
||||||
|
font-weight: 700;
|
||||||
|
line-height: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Badges */
|
.badge-open { background: #fee2e2; color: #991b1b; }
|
||||||
.badge {
|
.badge-warning { background: #fef3c7; color: #b45309; }
|
||||||
display: inline-block;
|
.badge-info { background: #e0f2fe; color: #0369a1; }
|
||||||
padding: 5px 10px;
|
.badge-paid { background: #dcfce7; color: #166534; }
|
||||||
font-size: 0.85em;
|
|
||||||
font-weight: bold;
|
|
||||||
border-radius: 20px;
|
|
||||||
color: #fff;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
.bg-danger { background-color: var(--danger); }
|
.mono {
|
||||||
.bg-warning { background-color: var(--warning); color: #000; }
|
font-family: monospace;
|
||||||
.bg-info { background-color: var(--info); color: #000; }
|
font-size: 0.92rem;
|
||||||
.bg-success { background-color: var(--success); }
|
}
|
||||||
|
|
||||||
.text-danger {
|
.text-danger {
|
||||||
color: var(--danger);
|
color: #dc2626;
|
||||||
font-weight: bold;
|
font-weight: 700;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Buttons */
|
.empty-state {
|
||||||
.btn {
|
|
||||||
padding: 10px 15px;
|
|
||||||
border-radius: 4px;
|
|
||||||
text-decoration: none;
|
|
||||||
font-weight: bold;
|
|
||||||
color: #fff;
|
|
||||||
background-color: #6c757d;
|
|
||||||
border: none;
|
|
||||||
cursor: pointer;
|
|
||||||
transition: background 0.2s;
|
|
||||||
}
|
|
||||||
|
|
||||||
.btn:hover { background-color: #5a6268; }
|
|
||||||
|
|
||||||
/* Alert */
|
|
||||||
.alert-success {
|
|
||||||
background-color: #d1e7dd;
|
|
||||||
color: #0f5132;
|
|
||||||
padding: 15px;
|
|
||||||
border-radius: 4px;
|
|
||||||
text-align: center;
|
text-align: center;
|
||||||
border: 1px solid #badbcc;
|
color: #6b7280;
|
||||||
|
padding: 36px 20px;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 900px) {
|
||||||
|
.mahnungen-table {
|
||||||
|
display: block;
|
||||||
|
overflow-x: auto;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
|
|
||||||
<!-- ==========================================
|
<div class="mahnungen-shell">
|
||||||
HTML CONTENT (JINJA2)
|
<div class="mahnungen-head">
|
||||||
========================================== -->
|
<h1>🚨 Mahnungsübersicht</h1>
|
||||||
<div class="container">
|
<div class="head-actions">
|
||||||
|
<a class="btn btn-outline-secondary" href="{{ url_for('library_loans_admin') }}">Zur Ausleihenverwaltung</a>
|
||||||
<div class="header-bar">
|
<a class="btn btn-secondary" href="{{ url_for('library_view') }}">Bibliothek öffnen</a>
|
||||||
<h2>🚨 Mahnungsübersicht</h2>
|
</div>
|
||||||
<a href="{{ url_for('library_loans_admin') }}" class="btn">Zurück zur Bibliothek</a>
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="card">
|
<div class="mahnungen-card">
|
||||||
{% if overdue_list %}
|
{% if overdue_list %}
|
||||||
|
<div class="search-box-wrapper">
|
||||||
|
<input type="text" id="searchInput" class="search-box" placeholder="🔍 Suche nach Nutzer, Klasse oder Gegenstand..." onkeyup="filterTable()">
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- Suchfeld für das JavaScript -->
|
<table class="mahnungen-table" id="mahnungTable">
|
||||||
<input type="text" id="searchInput" class="search-box" placeholder="Suche nach Nutzer, Klasse oder Gegenstand..." onkeyup="filterTable()">
|
|
||||||
|
|
||||||
<table class="table" id="mahnungTable">
|
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Nutzer</th>
|
<th>Nutzer</th>
|
||||||
@@ -170,27 +159,25 @@
|
|||||||
<tbody>
|
<tbody>
|
||||||
{% for item in overdue_list %}
|
{% for item in overdue_list %}
|
||||||
<tr>
|
<tr>
|
||||||
<td><strong>{{ item.user }}</strong></td>
|
<td><strong>{{ item.user or '—' }}</strong></td>
|
||||||
<td>{{ item.klasse }}</td>
|
<td>{{ item.klasse or '—' }}</td>
|
||||||
<td>{{ item.item_name }}</td>
|
<td>{{ item.item_name or '—' }}</td>
|
||||||
<td>{{ item.due_date }}</td>
|
<td><span class="mono">{{ item.due_date or '—' }}</span></td>
|
||||||
<td class="text-danger">{{ item.days_overdue }} Tage</td>
|
<td class="text-danger">{{ item.days_overdue }} Tage</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
{% if item.mahnstufe == 2 %}
|
{% if item.mahnstufe == 2 %}
|
||||||
<span class="badge bg-danger">Stufe 2 (Gesperrt)</span>
|
<span class="badge-pill badge-open">Stufe 2 (Gesperrt)</span>
|
||||||
{% elif item.mahnstufe == 1 %}
|
{% elif item.mahnstufe == 1 %}
|
||||||
<span class="badge bg-warning">Stufe 1 (Gewarnt)</span>
|
<span class="badge-pill badge-warning">Stufe 1 (Gewarnt)</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-info">Stufe 0 (Neu)</span>
|
<span class="badge-pill badge-info">Stufe 0 (Neu)</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<td>
|
<td>
|
||||||
{% if item.is_blocked %}
|
{% if item.is_blocked %}
|
||||||
<span class="badge bg-danger">Gesperrt</span>
|
<span class="badge-pill badge-open">Gesperrt</span>
|
||||||
{% else %}
|
{% else %}
|
||||||
<span class="badge bg-success">Aktiv</span>
|
<span class="badge-pill badge-paid">Aktiv</span>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@@ -198,59 +185,41 @@
|
|||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
{% else %}
|
{% else %}
|
||||||
<div class="alert-success">
|
<div class="empty-state">
|
||||||
<strong>Hervorragend!</strong> Aktuell gibt es keine überfälligen Ausleihen im System.
|
<strong>Hervorragend!</strong> Aktuell gibt es keine überfälligen Ausleihen im System.
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- ==========================================
|
|
||||||
JAVASCRIPT
|
|
||||||
========================================== -->
|
|
||||||
<script>
|
<script>
|
||||||
/**
|
|
||||||
* Funktion: filterTable()
|
|
||||||
* Liest die Eingabe aus dem Suchfeld und filtert die Tabellenzeilen live.
|
|
||||||
* Durchsucht Nutzer, Klassen und Gegenstände.
|
|
||||||
*/
|
|
||||||
function filterTable() {
|
function filterTable() {
|
||||||
// Hole den Wert aus dem Eingabefeld und wandle ihn in Kleinbuchstaben um
|
const input = document.getElementById("searchInput");
|
||||||
let input = document.getElementById("searchInput");
|
const filter = input.value.toLowerCase();
|
||||||
let filter = input.value.toLowerCase();
|
const table = document.getElementById("mahnungTable");
|
||||||
|
const tr = table.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
|
||||||
|
|
||||||
// Hole die Tabelle und alle Zeilen (tr) aus dem tbody
|
|
||||||
let table = document.getElementById("mahnungTable");
|
|
||||||
let tr = table.getElementsByTagName("tbody")[0].getElementsByTagName("tr");
|
|
||||||
|
|
||||||
// Durchlaufe alle Zeilen
|
|
||||||
for (let i = 0; i < tr.length; i++) {
|
for (let i = 0; i < tr.length; i++) {
|
||||||
// Hole die Zellen für Nutzer (0), Klasse (1) und Gegenstand (2)
|
const tdUser = tr[i].getElementsByTagName("td")[0];
|
||||||
let tdUser = tr[i].getElementsByTagName("td")[0];
|
const tdClass = tr[i].getElementsByTagName("td")[1];
|
||||||
let tdClass = tr[i].getElementsByTagName("td")[1];
|
const tdItem = tr[i].getElementsByTagName("td")[2];
|
||||||
let tdItem = tr[i].getElementsByTagName("td")[2];
|
|
||||||
|
|
||||||
if (tdUser || tdClass || tdItem) {
|
if (tdUser || tdClass || tdItem) {
|
||||||
// Extrahiere den Text
|
const textUser = tdUser.textContent || tdUser.innerText;
|
||||||
let textUser = tdUser.textContent || tdUser.innerText;
|
const textClass = tdClass.textContent || tdClass.innerText;
|
||||||
let textClass = tdClass.textContent || tdClass.innerText;
|
const textItem = tdItem.textContent || tdItem.innerText;
|
||||||
let textItem = tdItem.textContent || tdItem.innerText;
|
|
||||||
|
|
||||||
// Prüfe, ob der Suchbegriff in einer der drei Spalten vorkommt
|
|
||||||
if (
|
if (
|
||||||
textUser.toLowerCase().indexOf(filter) > -1 ||
|
textUser.toLowerCase().indexOf(filter) > -1 ||
|
||||||
textClass.toLowerCase().indexOf(filter) > -1 ||
|
textClass.toLowerCase().indexOf(filter) > -1 ||
|
||||||
textItem.toLowerCase().indexOf(filter) > -1
|
textItem.toLowerCase().indexOf(filter) > -1
|
||||||
) {
|
) {
|
||||||
tr[i].style.display = ""; // Zeile anzeigen
|
tr[i].style.display = "";
|
||||||
} else {
|
} else {
|
||||||
tr[i].style.display = "none"; // Zeile ausblenden
|
tr[i].style.display = "none";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user