Removal again
Release Inventarsystem / release-docker (push) Successful in 3m6s

This commit is contained in:
2026-08-22 15:14:26 +02:00
parent 17b58ff7ca
commit 2cd95ef808
3 changed files with 512 additions and 2 deletions
+1
View File
@@ -1373,6 +1373,7 @@
<li><h6 class="dropdown-header">Bibliotheks-Verwaltung</h6></li>
{% if current_permissions.pages.get('library_loans_admin', False) %}
<li><a class="dropdown-item" href="{{ url_for('library_loans_admin') }}">Alle Ausleihen/Alle Defekten Items</a></li>
<li><a class="dropdown-item" href="{{ url_for('mahnungen_admin') }}">Mahnungen</a></li>
{% endif %}
{% if student_cards_module_enabled %}
{% if current_permissions.actions.get('can_manage_users', False) %}
+256
View File
@@ -0,0 +1,256 @@
{% extends "base.html" %}
{% block title %}Mahnungen & Überfällige Ausleihen{% endblock %}
{% block content %}
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- ==========================================
CSS STYLES
========================================== -->
<style>
:root {
--bg-color: #f4f7f6;
--text-color: #333;
--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;
}
.container {
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
.header-bar {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
}
.header-bar h2 {
margin: 0;
color: #2c3e50;
}
/* Suchfeld Styling */
.search-box {
padding: 10px;
width: 100%;
max-width: 300px;
border: 1px solid var(--border-color);
border-radius: 4px;
font-size: 1rem;
margin-bottom: 20px;
}
/* Card & Table Styling */
.card {
background-color: #fff;
border-radius: 8px;
box-shadow: 0 4px 6px rgba(0,0,0,0.05);
padding: 20px;
overflow-x: auto;
}
.table {
width: 100%;
border-collapse: collapse;
text-align: left;
}
.table th, .table td {
padding: 12px 15px;
border-bottom: 1px solid var(--border-color);
}
.table th {
background-color: #f8f9fa;
font-weight: 600;
color: #495057;
}
.table tbody tr:hover {
background-color: #f8f9fa;
}
/* Badges */
.badge {
display: inline-block;
padding: 5px 10px;
font-size: 0.85em;
font-weight: bold;
border-radius: 20px;
color: #fff;
text-align: center;
}
.bg-danger { background-color: var(--danger); }
.bg-warning { background-color: var(--warning); color: #000; }
.bg-info { background-color: var(--info); color: #000; }
.bg-success { background-color: var(--success); }
.text-danger {
color: var(--danger);
font-weight: bold;
}
/* Buttons */
.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;
border: 1px solid #badbcc;
}
</style>
</head>
<body>
<!-- ==========================================
HTML CONTENT (JINJA2)
========================================== -->
<div class="container">
<div class="header-bar">
<h2>🚨 Mahnungsübersicht</h2>
<a href="{{ url_for('library_loans_admin') }}" class="btn">Zurück zur Bibliothek</a>
</div>
<div class="card">
{% if overdue_list %}
<!-- Suchfeld für das JavaScript -->
<input type="text" id="searchInput" class="search-box" placeholder="Suche nach Nutzer, Klasse oder Gegenstand..." onkeyup="filterTable()">
<table class="table" id="mahnungTable">
<thead>
<tr>
<th>Nutzer</th>
<th>Klasse</th>
<th>Gegenstand</th>
<th>Fällig am</th>
<th>Tage drüber</th>
<th>Mahnstufe</th>
<th>Konto-Status</th>
</tr>
</thead>
<tbody>
{% for item in overdue_list %}
<tr>
<td><strong>{{ item.user }}</strong></td>
<td>{{ item.klasse }}</td>
<td>{{ item.item_name }}</td>
<td>{{ item.due_date }}</td>
<td class="text-danger">{{ item.days_overdue }} Tage</td>
<td>
{% if item.mahnstufe == 2 %}
<span class="badge bg-danger">Stufe 2 (Gesperrt)</span>
{% elif item.mahnstufe == 1 %}
<span class="badge bg-warning">Stufe 1 (Gewarnt)</span>
{% else %}
<span class="badge bg-info">Stufe 0 (Neu)</span>
{% endif %}
</td>
<td>
{% if item.is_blocked %}
<span class="badge bg-danger">Gesperrt</span>
{% else %}
<span class="badge bg-success">Aktiv</span>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<div class="alert-success">
<strong>Hervorragend!</strong> Aktuell gibt es keine überfälligen Ausleihen im System.
</div>
{% endif %}
</div>
</div>
<!-- ==========================================
JAVASCRIPT
========================================== -->
<script>
/**
* Funktion: filterTable()
* Liest die Eingabe aus dem Suchfeld und filtert die Tabellenzeilen live.
* Durchsucht Nutzer, Klassen und Gegenstände.
*/
function filterTable() {
// Hole den Wert aus dem Eingabefeld und wandle ihn in Kleinbuchstaben um
let input = document.getElementById("searchInput");
let filter = input.value.toLowerCase();
// 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++) {
// Hole die Zellen für Nutzer (0), Klasse (1) und Gegenstand (2)
let tdUser = tr[i].getElementsByTagName("td")[0];
let tdClass = tr[i].getElementsByTagName("td")[1];
let tdItem = tr[i].getElementsByTagName("td")[2];
if (tdUser || tdClass || tdItem) {
// Extrahiere den Text
let textUser = tdUser.textContent || tdUser.innerText;
let textClass = tdClass.textContent || tdClass.innerText;
let textItem = tdItem.textContent || tdItem.innerText;
// Prüfe, ob der Suchbegriff in einer der drei Spalten vorkommt
if (
textUser.toLowerCase().indexOf(filter) > -1 ||
textClass.toLowerCase().indexOf(filter) > -1 ||
textItem.toLowerCase().indexOf(filter) > -1
) {
tr[i].style.display = ""; // Zeile anzeigen
} else {
tr[i].style.display = "none"; // Zeile ausblenden
}
}
}
}
</script>
</body>
</html>
{% endblock %}