Compare commits
5 Commits
v1.0.2-dev.2
...
v1.0.4
| Author | SHA1 | Date | |
|---|---|---|---|
| 3b0d499958 | |||
| a7494648d8 | |||
| 8d8609fd70 | |||
| 18c831eb42 | |||
| 8895283904 |
+4
-2
@@ -8529,7 +8529,7 @@ def parse_csv_users(file_bytes):
|
||||
|
||||
return parsed_users
|
||||
|
||||
def generate_compliant_password(length=16):
|
||||
def generate_compliant_password(length=6):
|
||||
lowers = string.ascii_lowercase
|
||||
uppers = string.ascii_uppercase
|
||||
digits = string.digits
|
||||
@@ -8664,7 +8664,9 @@ def register_csv():
|
||||
|
||||
# Benutzernamen & Passwort generieren
|
||||
username = us.build_unique_username_from_name(name, last_name)
|
||||
password = generate_compliant_password(5)
|
||||
password = generate_compliant_password(6)
|
||||
|
||||
password = us.check_password_strength(password) and password or generate_compliant_password(6)
|
||||
|
||||
action_permissions = None
|
||||
page_permissions = None
|
||||
|
||||
@@ -1,11 +1,3 @@
|
||||
<!--
|
||||
Copyright 2025-2026 AIIrondev
|
||||
|
||||
Licensed under the Inventarsystem EULA (Endbenutzer-Lizenzvertrag).
|
||||
See Legal/LICENSE for the full license text.
|
||||
Unauthorized commercial use, SaaS hosting, or removal of branding is prohibited.
|
||||
For commercial licensing inquiries: https://github.com/AIIrondev
|
||||
-->
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}Bibliotheksausweise - Inventarsystem{% endblock %}
|
||||
@@ -21,7 +13,6 @@
|
||||
gap: 15px;
|
||||
}
|
||||
|
||||
/* Neu strukturiertes Layout für Formular & Import */
|
||||
.dashboard-grid {
|
||||
display: grid;
|
||||
grid-template-columns: 2fr 1fr;
|
||||
@@ -145,6 +136,38 @@
|
||||
background: #5a6268;
|
||||
}
|
||||
|
||||
/* Filter Controls Styling */
|
||||
.filter-bar {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
margin-bottom: 15px;
|
||||
flex-wrap: wrap;
|
||||
align-items: center;
|
||||
background: var(--ui-bg);
|
||||
padding: 12px;
|
||||
border-radius: 8px;
|
||||
border: 1px solid #ddd;
|
||||
}
|
||||
|
||||
.filter-bar input,
|
||||
.filter-bar select {
|
||||
padding: 8px 12px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
font-size: 14px;
|
||||
}
|
||||
|
||||
.filter-bar input {
|
||||
flex: 1;
|
||||
min-width: 200px;
|
||||
}
|
||||
|
||||
.filter-counter {
|
||||
font-size: 13px;
|
||||
color: #666;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.cards-table {
|
||||
width: 100%;
|
||||
border-collapse: collapse;
|
||||
@@ -255,7 +278,8 @@
|
||||
}
|
||||
|
||||
:root[data-theme="dark"] .student-card-form,
|
||||
:root[data-theme="dark"] .import-card {
|
||||
:root[data-theme="dark"] .import-card,
|
||||
:root[data-theme="dark"] .filter-bar {
|
||||
background: var(--ui-surface) !important;
|
||||
color: var(--ui-text) !important;
|
||||
border-color: var(--ui-border) !important;
|
||||
@@ -269,7 +293,8 @@
|
||||
:root[data-theme="dark"] .import-card p,
|
||||
:root[data-theme="dark"] .rollover-hint,
|
||||
:root[data-theme="dark"] .empty-state,
|
||||
:root[data-theme="dark"] .empty-state p {
|
||||
:root[data-theme="dark"] .empty-state p,
|
||||
:root[data-theme="dark"] .filter-counter {
|
||||
color: var(--ui-text-muted) !important;
|
||||
}
|
||||
|
||||
@@ -286,6 +311,8 @@
|
||||
:root[data-theme="dark"] .form-group input,
|
||||
:root[data-theme="dark"] .form-group select,
|
||||
:root[data-theme="dark"] .form-group textarea,
|
||||
:root[data-theme="dark"] .filter-bar input,
|
||||
:root[data-theme="dark"] .filter-bar select,
|
||||
:root[data-theme="dark"] .export-buttons form,
|
||||
:root[data-theme="dark"] .export-buttons select {
|
||||
background: var(--ui-bg) !important;
|
||||
@@ -297,6 +324,8 @@
|
||||
:root[data-theme="dark"] .form-group input:focus,
|
||||
:root[data-theme="dark"] .form-group select:focus,
|
||||
:root[data-theme="dark"] .form-group textarea:focus,
|
||||
:root[data-theme="dark"] .filter-bar input:focus,
|
||||
:root[data-theme="dark"] .filter-bar select:focus,
|
||||
:root[data-theme="dark"] .export-buttons select:focus {
|
||||
border-color: #60a5fa !important;
|
||||
box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.22) !important;
|
||||
@@ -334,6 +363,16 @@
|
||||
.export-buttons > a {
|
||||
flex: 1 1 100%;
|
||||
}
|
||||
|
||||
.filter-bar {
|
||||
flex-direction: column;
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.filter-counter {
|
||||
margin-left: 0;
|
||||
text-align: right;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 992px) {
|
||||
@@ -503,7 +542,20 @@
|
||||
<div>
|
||||
<h2 style="margin-bottom: 15px;">Registrierte Ausweise</h2>
|
||||
{% if student_cards %}
|
||||
<table class="cards-table">
|
||||
<!-- Filter Options -->
|
||||
<div class="filter-bar">
|
||||
<input type="text" id="cardSearchInput" placeholder="🔍 Name oder Ausweis-ID suchen...">
|
||||
<select id="classFilterSelect">
|
||||
<option value="">Alle Klassen</option>
|
||||
{% for cls in available_classes %}
|
||||
<option value="{{ cls }}">{{ cls }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<button type="button" id="clearFilterBtn" class="btn-cancel" style="padding: 8px 12px; font-size: 13px;">Zurücksetzen</button>
|
||||
<span class="filter-counter" id="filterCounter">Angezeigt: {{ student_cards|length }} / {{ student_cards|length }}</span>
|
||||
</div>
|
||||
|
||||
<table class="cards-table" id="cardsTable">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Ausweis-ID</th>
|
||||
@@ -516,7 +568,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for card in student_cards %}
|
||||
<tr>
|
||||
<tr class="card-row" data-id="{{ card.AusweisId|lower }}" data-name="{{ card.SchülerName|lower }}" data-class="{{ card.Klasse or '' }}">
|
||||
<td><strong>{{ card.AusweisId }}</strong></td>
|
||||
<td>{{ card.SchülerName }}</td>
|
||||
<td>{{ card.Klasse or '—' }}</td>
|
||||
@@ -546,6 +598,10 @@
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
<div id="noResultsMsg" class="empty-state" style="display: none;">
|
||||
<p>Keine passende Ausweise für diesen Filter gefunden.</p>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="empty-state">
|
||||
<p>Keine Bibliotheksausweise registriert.</p>
|
||||
@@ -557,7 +613,56 @@
|
||||
|
||||
<script src="https://cdn.jsdelivr.net/npm/qrcode.js"></script>
|
||||
<script>
|
||||
// All PDF exports now go through backend routes
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
const searchInput = document.getElementById('cardSearchInput');
|
||||
const classSelect = document.getElementById('classFilterSelect');
|
||||
const clearBtn = document.getElementById('clearFilterBtn');
|
||||
const filterCounter = document.getElementById('filterCounter');
|
||||
const rows = document.querySelectorAll('.card-row');
|
||||
const noResultsMsg = document.getElementById('noResultsMsg');
|
||||
const totalRows = rows.length;
|
||||
|
||||
function filterCards() {
|
||||
const query = searchInput ? searchInput.value.toLowerCase().trim() : '';
|
||||
const selectedClass = classSelect ? classSelect.value : '';
|
||||
let visibleCount = 0;
|
||||
|
||||
rows.forEach(row => {
|
||||
const id = row.getAttribute('data-id') || '';
|
||||
const name = row.getAttribute('data-name') || '';
|
||||
const cardClass = row.getAttribute('data-class') || '';
|
||||
|
||||
const matchesQuery = !query || id.includes(query) || name.includes(query);
|
||||
const matchesClass = !selectedClass || cardClass === selectedClass;
|
||||
|
||||
if (matchesQuery && matchesClass) {
|
||||
row.style.display = '';
|
||||
visibleCount++;
|
||||
} else {
|
||||
row.style.display = 'none';
|
||||
}
|
||||
});
|
||||
|
||||
if (filterCounter) {
|
||||
filterCounter.textContent = `Angezeigt: ${visibleCount} / ${totalRows}`;
|
||||
}
|
||||
|
||||
if (noResultsMsg) {
|
||||
noResultsMsg.style.display = (visibleCount === 0 && totalRows > 0) ? 'block' : 'none';
|
||||
}
|
||||
}
|
||||
|
||||
if (searchInput) searchInput.addEventListener('input', filterCards);
|
||||
if (classSelect) classSelect.addEventListener('change', filterCards);
|
||||
|
||||
if (clearBtn) {
|
||||
clearBtn.addEventListener('click', function() {
|
||||
if (searchInput) searchInput.value = '';
|
||||
if (classSelect) classSelect.value = '';
|
||||
filterCards();
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
@@ -228,7 +228,12 @@
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="new-password" class="form-label">Neues Passwort:</label>
|
||||
<input type="password" class="form-control" id="new-password" name="new_password" required>
|
||||
<div class="input-group">
|
||||
<input type="password" class="form-control" id="new-password" name="new_password" required>
|
||||
<button class="btn btn-outline-secondary" type="button" id="togglePasswordBtn" onclick="togglePasswordVisibility()">
|
||||
Anzeigen
|
||||
</button>
|
||||
</div>
|
||||
<div class="password-requirements small text-muted mt-1">
|
||||
<p>Das Passwort muss mindestens 6 Zeichen lang sein.</p>
|
||||
</div>
|
||||
@@ -397,14 +402,36 @@
|
||||
modal.show();
|
||||
}
|
||||
|
||||
function togglePasswordVisibility() {
|
||||
var passwordInput = document.getElementById('new-password');
|
||||
var toggleBtn = document.getElementById('togglePasswordBtn');
|
||||
|
||||
if (passwordInput.type === 'password') {
|
||||
passwordInput.type = 'text';
|
||||
toggleBtn.textContent = 'Verbergen';
|
||||
} else {
|
||||
passwordInput.type = 'password';
|
||||
toggleBtn.textContent = 'Anzeigen';
|
||||
}
|
||||
}
|
||||
|
||||
function openResetPasswordModal(username) {
|
||||
document.getElementById('reset-username').value = username;
|
||||
document.getElementById('username-display').value = username;
|
||||
|
||||
|
||||
var passwordInput = document.getElementById('new-password');
|
||||
var toggleBtn = document.getElementById('togglePasswordBtn');
|
||||
|
||||
// Reset password field state on modal open
|
||||
passwordInput.value = '';
|
||||
passwordInput.type = 'password';
|
||||
if (toggleBtn) {
|
||||
toggleBtn.textContent = 'Anzeigen';
|
||||
}
|
||||
|
||||
var modal = new bootstrap.Modal(document.getElementById('resetPasswordModal'));
|
||||
modal.show();
|
||||
}
|
||||
|
||||
function openPermissionsModal(button) {
|
||||
var username = button.getAttribute('data-username') || '';
|
||||
var preset = button.getAttribute('data-preset') || 'standard_user';
|
||||
|
||||
Reference in New Issue
Block a user