Commit d447ba33 authored by fred's avatar fred
Browse files

rewrite main nav active section highlighting

parent 7164ad74
......@@ -134,23 +134,30 @@ def metanav(context):
except KeyError:
# a context without 'requests' may happen when rendering error pages
request_path = 'xxx'
section = 'About'
paths = {
'/actus/': 'News',
'/sons/': 'Listen',
'/podcasts/': 'Listen',
'/topiks/': 'Topiks',
'/emissions': 'Emissions',
'/grille': 'Emissions',
'/programme/': 'Emissions',
'/recherche/': 'Search',
'/la-radio/': 'About',
section = ''
if request_path == '/':
section = 'Home'
elif request_path.startswith('/actus/'):
section = 'News'
elif request_path.startswith('/sons/'):
section = 'Listen'
elif request_path.startswith('/topiks'):
section = 'Topiks'
elif request_path.startswith('/emissions') or request_path == '/grille' or request_path == '/programme/':
section = 'Emissions'
elif request_path == '/recherche/':
section = 'Search'
for path, section_name in paths.items():
if request_path.startswith(path):
section = section_name
return {
'sectionName': section,
def weekview(year=None, week=None):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment