From c1a6a145dceac91e5e85fe683c6fbd8284e1429a Mon Sep 17 00:00:00 2001 From: AIIrondev Date: Mon, 24 Aug 2026 18:00:35 +0200 Subject: [PATCH] The School year rollover button is placed in the school settings. --- Web/app.py | 63 ----------------- Web/templates/admin_school_settings.html | 86 +++++++++++++++++++++++- 2 files changed, 83 insertions(+), 66 deletions(-) diff --git a/Web/app.py b/Web/app.py index 8a7beaf..b789772 100755 --- a/Web/app.py +++ b/Web/app.py @@ -228,7 +228,6 @@ def rollover_student_card_classes(dry_run=False, *, max_class=None, graduate_lab client.close() -# Admin route to trigger rollover manually @app.route('/admin/trigger_school_year_rollover', methods=['POST']) def admin_trigger_school_year_rollover(): if 'username' not in session: @@ -3038,42 +3037,6 @@ def optimized_image(filename): app.logger.error(f"Error serving optimized image {filename}: {str(e)}") return Response("Optimized image not found", status=404) - -# @app.route('/QRCodes/') -# def qrcode_file(filename): -# """ -# Serve QR code files from the QRCodes directory. -# -# Args: -# filename (str): Name of the QR code file to serve -# -# Returns: -# flask.Response: The requested QR code file or placeholder image if not found -# """ -# try: -# # Check production path first -# prod_path = "/var/Inventarsystem/Web/QRCodes" -# dev_path = app.config['QR_CODE_FOLDER'] -# if os.path.exists(os.path.join(prod_path, filename)): -# return send_from_directory(prod_path, filename) -# if os.path.exists(os.path.join(dev_path, filename)): -# return send_from_directory(dev_path, filename) -# -# # Use a placeholder image if file not found - first try SVG, then PNG -# svg_placeholder_path = os.path.join(app.static_folder, 'img', 'no-image.svg') -# png_placeholder_path = os.path.join(app.static_folder, 'img', 'no-image.png') -# -# if os.path.exists(svg_placeholder_path): -# return send_from_directory(app.static_folder, 'img/no-image.svg') -# elif os.path.exists(png_placeholder_path): -# return send_from_directory(app.static_folder, 'img/no-image.png') -# else: -# return send_from_directory(app.static_folder, 'favicon.ico') -# except Exception as e: -# print(f"Error serving QR code {filename}: {str(e)}") -# return Response("QR code not found", status=404) - - @app.route('/') def catch_all_files(filename): """ @@ -3136,32 +3099,6 @@ def test_connection(): """ return {'status': 'success', 'message': 'Connection successful', 'status_code': 200} -""" if sucess in deployment the funktion can be removed -@app.route('/user_status') -def user_status(): - - API endpoint to get the current user's status (username, admin status). - Used by JavaScript in templates to personalize the UI. - - Returns: - JSON: User status information or error if not authenticated - - if 'username' in session: - is_admin = us.check_admin(session['username']) - return jsonify({ - 'authenticated': True, - 'username': session['username'], - 'is_admin': is_admin - }) - else: - return jsonify({ - 'authenticated': False, - 'error': 'Not logged in' - }), 401 -""" - - -##################################################### changes to be made to account for the new account permison managment system ############################## @app.route('/') def home(): diff --git a/Web/templates/admin_school_settings.html b/Web/templates/admin_school_settings.html index 2fc10b3..468c5e9 100644 --- a/Web/templates/admin_school_settings.html +++ b/Web/templates/admin_school_settings.html @@ -120,9 +120,64 @@

Diese Angaben erscheinen künftig im amtlichen Audit-PDF und in anderen Behördenberichten.

+ + +
+
+

Erweiterte Aktionen

+
+
+
+ Schuljahreswechsel durchführen + Diese Aktion bereitet das System auf das neue Schuljahr vor (z. B. Hochstufen von Klassen). +
+ +
+
+ + -{% endblock %} +{% endblock %} \ No newline at end of file