diff --git a/Web/__pycache__/app.cpython-312.pyc b/Web/__pycache__/app.cpython-312.pyc index e5c63aa..8e8f096 100644 Binary files a/Web/__pycache__/app.cpython-312.pyc and b/Web/__pycache__/app.cpython-312.pyc differ diff --git a/Web/app.py b/Web/app.py index 9c26acc..e13da39 100755 --- a/Web/app.py +++ b/Web/app.py @@ -113,6 +113,26 @@ def _get_asset_version(): return APP_VERSION +def _is_library_module_path(path): + """Return True when the current request path belongs to the library module.""" + if not path: + return False + + library_prefixes = ( + '/library', + '/library_', + '/student_cards', + ) + return path.startswith(library_prefixes) + + +def _get_current_module(path): + """Resolve the active UI module for navbar separation.""" + if cfg.LIBRARY_MODULE_ENABLED and _is_library_module_path(path): + return 'library' + return 'inventory' + + def _parse_money_value(value): """Parse a user-facing money value into a float when possible.""" if value is None: @@ -318,9 +338,13 @@ def inject_version(): is_admin = us.check_admin(session['username']) except Exception: is_admin = False + + current_module = _get_current_module(request.path) + return { 'APP_VERSION': APP_VERSION, 'ASSET_VERSION': asset_version, + 'CURRENT_MODULE': current_module, 'school_periods': SCHOOL_PERIODS, 'library_module_enabled': cfg.LIBRARY_MODULE_ENABLED, 'student_cards_module_enabled': cfg.STUDENT_CARDS_MODULE_ENABLED, diff --git a/Web/templates/base.html b/Web/templates/base.html index 070d7b7..6cf44a5 100755 --- a/Web/templates/base.html +++ b/Web/templates/base.html @@ -7,7 +7,7 @@ For commercial licensing inquiries: https://github.com/AIIrondev --> - + @@ -369,7 +369,7 @@ Module:
📦 Inventarsystem @@ -377,7 +377,7 @@ {% if library_module_enabled %}
📚 Bibliothek @@ -386,48 +386,7 @@
{% endif %} - - - + {% if CURRENT_MODULE != 'library' %} + {% endif %} - {% if library_module_enabled %} -