Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6fcabc8638 | |||
| 3068f44563 | |||
| c4dd18a2e4 | |||
| d0ac21e7dd | |||
| b4a505c20b | |||
| 39302d4d1f | |||
| e46f8b0c66 | |||
| 06486f039f | |||
| feac00f0df | |||
| 0b0169ef96 |
+3
-2
@@ -3157,6 +3157,7 @@ def library_loans_admin():
|
||||
'damage_text': (damage_reports[0].get('description', '') if damage_reports else ''),
|
||||
'available': bool(item_doc.get('Verfuegbar', False)),
|
||||
'last_updated': fmt_dt(item_doc.get('LastUpdated')),
|
||||
'acquisition_costs': item_doc.get('Anschaffungskosten', "")
|
||||
})
|
||||
|
||||
return render_template(
|
||||
@@ -3605,7 +3606,8 @@ def api_item_detail(item_id):
|
||||
borrows_html = ''
|
||||
if borrow_records:
|
||||
rows = []
|
||||
for rec in borrow_records:
|
||||
|
||||
for rec in borrow_records[:3]:
|
||||
user_raw = rec.get('User')
|
||||
try:
|
||||
user = decrypt_text(user_raw) if user_raw is not None else ''
|
||||
@@ -3615,7 +3617,6 @@ def api_item_detail(item_id):
|
||||
start = fmt_dt(rec.get('Start'))
|
||||
end = fmt_dt(rec.get('End'))
|
||||
notes = html.escape(str(rec.get('Notes') or ''))
|
||||
|
||||
rows.append(
|
||||
f"<li><strong>{html.escape(str(user or '-'))}</strong> — "
|
||||
f"{html.escape(str(status))} — "
|
||||
|
||||
+24
-15
@@ -1375,8 +1375,10 @@
|
||||
<li><a class="dropdown-item" href="{{ url_for('library_loans_admin') }}">Ausleihen / Defekte Items</a></li>
|
||||
{% endif %}
|
||||
{% if student_cards_module_enabled %}
|
||||
{% if current_permissions.actions.get('can_manage_users', False) %}
|
||||
<li><a class="dropdown-item" href="{{ url_for('student_cards_admin') }}">Bibliotheksausweis</a></li>
|
||||
{% endif %}
|
||||
{% endif %}
|
||||
{% if current_permissions.pages.get('admin_school_settings', False) %}
|
||||
<li><a class="dropdown-item" href="{{ url_for('admin_school_settings') }}">Schulstammdaten</a></li>
|
||||
{% endif %}
|
||||
@@ -1619,11 +1621,10 @@
|
||||
<div id="cookie-banner" role="dialog" aria-live="polite" aria-label="Cookie-Hinweis">
|
||||
<div class="cb-inner">
|
||||
<div class="cb-text">
|
||||
Wir verwenden technisch notwendige Cookies, um Ihre Sitzung zu verwalten und die Anwendung bereitzustellen. Bitte akzeptieren Sie Cookies, um fortzufahren.
|
||||
Wir verwenden ausschließlich technisch notwendige Cookies, um Ihre Sitzung zu verwalten und die Anwendung bereitzustellen. Bitte bestätigen Sie dies, um fortzufahren.
|
||||
</div>
|
||||
<div class="cb-actions">
|
||||
<button class="btn-decline" id="cookie-decline">Ablehnen</button>
|
||||
<button class="btn-accept" id="cookie-accept">Akzeptieren</button>
|
||||
<button class="btn-accept" id="cookie-accept">Notwendige Cookies akzeptieren</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -1728,31 +1729,39 @@
|
||||
(function(){
|
||||
function getCookie(name){
|
||||
const v = document.cookie.split(';').map(s=>s.trim());
|
||||
for(const c of v){ if(c.startsWith(name+'=')) return decodeURIComponent(c.split('=')[1]); }
|
||||
for(const c of v){
|
||||
if(c.startsWith(name+'=')) return decodeURIComponent(c.split('=')[1]);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
function setCookie(name, value, days){
|
||||
const d = new Date(); d.setTime(d.getTime() + (days*24*60*60*1000));
|
||||
const d = new Date();
|
||||
d.setTime(d.getTime() + (days*24*60*60*1000));
|
||||
document.cookie = name + '=' + encodeURIComponent(value) + ';expires=' + d.toUTCString() + ';path=/;SameSite=Lax';
|
||||
}
|
||||
function showBanner(){ var el = document.getElementById('cookie-banner'); if(el) el.style.display = 'block'; }
|
||||
function hideBanner(){ var el = document.getElementById('cookie-banner'); if(el) el.style.display = 'none'; }
|
||||
|
||||
// If not decided yet, show banner and block app until decision
|
||||
function showBanner(){
|
||||
var el = document.getElementById('cookie-banner');
|
||||
if(el) el.style.display = 'block';
|
||||
}
|
||||
|
||||
function hideBanner(){
|
||||
var el = document.getElementById('cookie-banner');
|
||||
if(el) el.style.display = 'none';
|
||||
}
|
||||
|
||||
// Prüfen, ob der Nutzer bereits zugestimmt hat
|
||||
const consent = getCookie('cookie_consent');
|
||||
if(!consent){
|
||||
showBanner();
|
||||
// Optionally blur content until consent
|
||||
document.body.style.filter = 'none';
|
||||
}
|
||||
|
||||
// Nur noch der Akzeptieren-Button für vitale Cookies ist vorhanden
|
||||
document.getElementById('cookie-accept')?.addEventListener('click', function(){
|
||||
setCookie('cookie_consent','accepted',365);
|
||||
setCookie('cookie_consent', 'vital_accepted', 365);
|
||||
hideBanner();
|
||||
});
|
||||
document.getElementById('cookie-decline')?.addEventListener('click', function(){
|
||||
setCookie('cookie_consent','declined',365);
|
||||
window.location.href = 'https://www.ecosia.org/';
|
||||
});
|
||||
|
||||
const username = {{ (session['username'] if 'username' in session else '')|tojson }};
|
||||
const isTutorialPage = window.location.pathname === {{ url_for('tutorial_page')|tojson }};
|
||||
|
||||
@@ -520,7 +520,16 @@
|
||||
window.openDamageReportPrompt = openDamageReportPrompt;
|
||||
|
||||
function openDamageInvoiceModal(row, description) {
|
||||
if (!damageInvoiceModal || !damageInvoiceForm) {
|
||||
const modal = document.getElementById('damage-invoice-modal');
|
||||
const form = document.getElementById('damage-invoice-form');
|
||||
const inputItem = document.getElementById('damage-invoice-item');
|
||||
const inputBorrower = document.getElementById('damage-invoice-borrower');
|
||||
const inputCode = document.getElementById('damage-invoice-code');
|
||||
const inputAmount = document.getElementById('damage-invoice-amount');
|
||||
const inputReason = document.getElementById('damage-invoice-reason');
|
||||
|
||||
if (!modal || !form) {
|
||||
console.error("Modal oder Formular nicht gefunden.");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -530,23 +539,29 @@
|
||||
const itemCode = row.dataset.itemCode || '';
|
||||
const itemCost = row.dataset.itemCost || '';
|
||||
|
||||
damageInvoiceForm.action = "{{ url_for('admin_create_invoice', borrow_id='__BORROW_ID__') }}".replace('__BORROW_ID__', borrowId);
|
||||
damageInvoiceItem.value = itemName;
|
||||
damageInvoiceBorrower.value = borrower;
|
||||
damageInvoiceCode.value = itemCode;
|
||||
damageInvoiceAmount.value = String(itemCost).replace(' EUR', '').trim();
|
||||
damageInvoiceReason.value = description || `Schaden gemeldet für ${itemName}`;
|
||||
damageInvoiceModal.style.display = 'block';
|
||||
damageInvoiceAmount.focus();
|
||||
form.action = "{{ url_for('admin_create_invoice', borrow_id='__BORROW_ID__') }}".replace('__BORROW_ID__', borrowId);
|
||||
|
||||
inputItem.value = itemName;
|
||||
inputBorrower.value = borrower;
|
||||
inputCode.value = itemCode;
|
||||
|
||||
inputAmount.value = String(itemCost).replace(' EUR', '').trim();
|
||||
|
||||
inputReason.value = description || `Schaden gemeldet für ${itemName}`;
|
||||
|
||||
modal.style.display = 'block';
|
||||
inputAmount.focus();
|
||||
}
|
||||
|
||||
function closeDamageInvoiceModal() {
|
||||
const modal = document.getElementById('damage-invoice-modal');
|
||||
if (modal) {
|
||||
modal.style.display = 'none';
|
||||
}
|
||||
}
|
||||
|
||||
window.openDamageInvoiceModal = openDamageInvoiceModal;
|
||||
|
||||
function closeDamageInvoiceModal() {
|
||||
if (damageInvoiceModal) {
|
||||
damageInvoiceModal.style.display = 'none';
|
||||
}
|
||||
}
|
||||
window.closeDamageInvoiceModal = closeDamageInvoiceModal;
|
||||
|
||||
if (damageInvoiceModal) {
|
||||
damageInvoiceModal.addEventListener('click', function(event) {
|
||||
|
||||
@@ -1416,8 +1416,8 @@
|
||||
<div>
|
||||
<label for="editLibraryType">Medientyp</label>
|
||||
<select id="editLibraryType" style="width: 100%;">
|
||||
<option value="book">Buch</option>
|
||||
<option value="schoolbook">Schulbuch</option>
|
||||
<option value="Buch">Buch</option>
|
||||
<option value="Schulbuch">Schulbuch</option>
|
||||
<option value="cd">CD</option>
|
||||
<option value="dvd">DVD</option>
|
||||
<option value="other">Sonstige Medien</option>
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/env bash
|
||||
set -euo pipefail
|
||||
|
||||
sudo find /tmp -maxdepth 1 -name "tmp.*" -exec rm -rf {} +
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 && pwd)"
|
||||
cd "$SCRIPT_DIR"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user