{# Single source of truth for the Settings in-page floating side menu. Used by settings.html (mode="tabs" -> client-side switchTab) and by encoding.html (mode="links" -> navigates back to the Settings tabs, with "Encoding" as the active entry). "Encoding" is always a real link to its own /encoding route (E2), inserted right after "General". is_admin gates the admin-only entries, matching settings.html's original gating. #} {# Three admin-only entries were added at the end of `rows`, and deliberately only three: rules + language profiles share one tab because they answer the same question ("how should this title be handled"), and everything operational -- workers, schema snapshots, quiet hours, diagnostics -- shares "Operations" rather than becoming four separate entries. Group management lives inside "Authentication" next to the user list, where anyone looking for it will already be. NOTE: a Jinja comment must NOT be placed inside the "set rows = [...]" expression below. Jinja does not strip comments inside an expression, so the hash is parsed as part of it and the whole page dies with a TemplateSyntaxError -- which is exactly what happened when this note was first written in there. (Jinja comments do not nest either, which is why this paragraph spells the markers out instead of showing them.) #} {% macro settings_menu(mode='tabs', active='overview', is_admin=True) %}
{%- set rows = [ ('overview', _('Overview'), false), ('general', _('General'), false), ('startpage', _('Start Page'), false), ('library', _('Library and Statistics'), false), ('design', _('Design'), false), ('sources', _('Sources'), true), ('downloads', _('Downloads'), false), ('autosync', 'Auto-Sync', false), ('network', _('Network & Access'), false), ('auth', _('Authentication'), true), ('api', 'API', true), ('privacy', _('Privacy & Telemetry'), true), ('backup', _('Backup'), true), ('updates', _('Updates'), false), ('rules', _('Rules & Languages'), true), ('operations', _('Operations'), true), ('audit', _('Audit Log'), true) ] -%} {%- for id, label, admin_only in rows %} {%- if not admin_only or is_admin %} {%- if mode == 'tabs' %} {%- else %} {{ label }} {%- endif %} {%- endif %} {%- if id == 'general' and is_admin %} {%- if mode == 'tabs' %} {%- else %} {{ _('Encoding') }} {%- endif %} {%- endif %} {%- endfor %}
{% endmacro %}