1
0
mirror of synced 2024-11-24 06:20:12 +01:00

Fix visual bug where navigating to admin/arcades/ would inadvertently highlight the "Arcades" top level as well.

This commit is contained in:
Jennifer Taylor 2020-05-08 20:07:33 +00:00
parent 7707e185cc
commit 4cf5ac2c02

View File

@ -110,18 +110,21 @@
<div class="navigation">
<ul class="navigation" id="nav">
{% for entry in navigation %}
<li class="{{ 'right' if entry.get('right_justify') else 'left' }} {{ 'selected' if entry['uri'] == current_path or (((entry.get('base_uri', '/nonexistent') or '/nonexistent') in current_path) and not (any(entry.get('entries'), 'uri', current_path))) else '' }}">
<li class="{{
'right' if entry.get('right_justify') else 'left' }}
{{ 'selected' if entry['uri'] == current_path or ((current_path.startswith(entry.get('base_uri', '/nonexistent') or '/nonexistent')) and not (any(entry.get('entries'), 'uri', current_path))) else ''
}}">
{% with uri = entry.get('uri') %}
{% with label = entry.get('label') %}
{% if label %}
{% if uri %}
<a
class="{{ 'current' if (entry['uri'] == current_path) or (any(entry.get('entries'), 'uri', current_path)) or ((entry.get('base_uri', '/nonexistent') or '/nonexistent') in current_path) else ''}} {{entry['gamecode']}} border"
class="{{ 'current' if (entry['uri'] == current_path) or (any(entry.get('entries'), 'uri', current_path)) or (current_path.startswith(entry.get('base_uri', '/nonexistent') or '/nonexistent')) else ''}} {{entry['gamecode']}} border"
href="{{ entry['uri'] }}"
>{{ entry['label'] }}</a>
{% else %}
<a
class="cursor {{ 'current' if (entry['uri'] == current_path) or (any(entry.get('entries'), 'uri', current_path)) or ((entry.get('base_uri', '/nonexistent') or '/nonexistent') in current_path) else ''}} {{entry['gamecode']}} border"
class="cursor {{ 'current' if (entry['uri'] == current_path) or (any(entry.get('entries'), 'uri', current_path)) or (current_path.startswith(entry.get('base_uri', '/nonexistent') or '/nonexistent')) else ''}} {{entry['gamecode']}} border"
>{{ entry['label'] }}</a>
{% endif %}
{% else %}