From 06486f039f980697ee010830c50d17f103af956a Mon Sep 17 00:00:00 2001 From: AIIrondev Date: Mon, 27 Jul 2026 14:34:59 +0200 Subject: [PATCH] changes for the loading of the recent borrowers that only the latest 3 get displayed --- Web/app.py | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) diff --git a/Web/app.py b/Web/app.py index c2a6718..ca8c90b 100755 --- a/Web/app.py +++ b/Web/app.py @@ -3605,24 +3605,25 @@ def api_item_detail(item_id): borrows_html = '' if borrow_records: rows = [] - for rec in borrow_records: - user_raw = rec.get('User') - try: - user = decrypt_text(user_raw) if user_raw is not None else '' - except Exception: - user = user_raw - status = rec.get('Status', '') - start = fmt_dt(rec.get('Start')) - end = fmt_dt(rec.get('End')) - notes = html.escape(str(rec.get('Notes') or '')) - - rows.append( - f"
  • {html.escape(str(user or '-'))} — " - f"{html.escape(str(status))} — " - f"{html.escape(str(start))} → {html.escape(str(end))}" - f"{(' — ' + notes) if notes else ''}
  • " - ) - borrows_html = f"

    Ausleihhistorie

    " + while len(rows) < 3: + for rec in borrow_records: + user_raw = rec.get('User') + try: + user = decrypt_text(user_raw) if user_raw is not None else '' + except Exception: + user = user_raw + status = rec.get('Status', '') + start = fmt_dt(rec.get('Start')) + end = fmt_dt(rec.get('End')) + notes = html.escape(str(rec.get('Notes') or '')) + + rows.append( + f"
  • {html.escape(str(user or '-'))} — " + f"{html.escape(str(status))} — " + f"{html.escape(str(start))} → {html.escape(str(end))}" + f"{(' — ' + notes) if notes else ''}
  • " + ) + borrows_html = f"

    Ausleihhistorie

    " detail_html = f"""

    {html.escape(str(item.get('Name', 'Untitled')))}