Browse Source

'about' navigation highlight set explicitly

php2python
Holger Frey 7 years ago
parent
commit
4c8e5c69da
  1. 2
      ordr2/templates/layout.jinja2
  2. 1
      ordr2/views/pages.py

2
ordr2/templates/layout.jinja2

@ -47,7 +47,7 @@
{% else %} {% else %}
<ul class="nav"> <ul class="nav">
<li {% if context.nav_highlight == 'register' %} class="active" {% endif %}><a href="{{request.resource_url(request.root, 'register')}}">Register</a></li> <li {% if context.nav_highlight == 'register' %} class="active" {% endif %}><a href="{{request.resource_url(request.root, 'register')}}">Register</a></li>
<li {% if not context.nav_highlight %} class="active" {% endif %}><a href="{{request.resource_url(request.root, 'about')}}">About</a></li> <li {% if context.nav_highlight == 'about' %} class="active" {% endif %}><a href="{{request.resource_url(request.root, 'about')}}">About</a></li>
</ul> </ul>
<form action="{{request.resource_url(request.root, 'account', 'login')}}" method="post" class="navbar-form pull-right"> <form action="{{request.resource_url(request.root, 'account', 'login')}}" method="post" class="navbar-form pull-right">
<input type="hidden" name="csrf_token" value="{{get_csrf_token()}}"> <input type="hidden" name="csrf_token" value="{{get_csrf_token()}}">

1
ordr2/views/pages.py

@ -19,6 +19,7 @@ def welcome(context, request):
renderer='ordr2:templates/pages/welcome.jinja2' renderer='ordr2:templates/pages/welcome.jinja2'
) )
def about(context, request): def about(context, request):
context.nav_highlight = 'about'
return {} return {}