# HG changeset patch # User Todd Larsen # Date 1222236028 0 # Node ID 8e3a18cead226e98dbd5389806b03866a35036b8 # Parent 14ede160ef1681908353ffec900198f2c245aa22 Replace mock-up of sidebar with first draft of dynamic sidebar functionality. diff -r 14ede160ef16 -r 8e3a18cead22 app/soc/templates/soc/base.html --- a/app/soc/templates/soc/base.html Wed Sep 24 05:58:45 2008 +0000 +++ b/app/soc/templates/soc/base.html Wed Sep 24 06:00:28 2008 +0000 @@ -70,65 +70,9 @@ Google Open Source Programs {% endblock %} - -{% if is_admin %} - +{% if sidebar_menu_html %} +{{ sidebar_menu_html|safe }} {% endif %} - {% endblock %} diff -r 14ede160ef16 -r 8e3a18cead22 app/soc/views/helpers/response_helpers.py --- a/app/soc/views/helpers/response_helpers.py Wed Sep 24 05:58:45 2008 +0000 +++ b/app/soc/views/helpers/response_helpers.py Wed Sep 24 06:00:28 2008 +0000 @@ -41,7 +41,9 @@ from soc.logic import system from soc.logic.site import id_user +from soc.logic.site import sidebar +from soc.views.helpers import html_menu from soc.views.helpers import request_helpers from soc.views.helpers import template_helpers @@ -107,6 +109,7 @@ 'is_debug': True if system.isDebug() is True 'sign_in': a Google Account login URL 'sign_out': a Google Account logout URL + 'sidebar_menu_html': an HTML string that renders the sidebar menu } """ if context is None: @@ -125,6 +128,12 @@ context['sign_out'] = context.get( 'sign_out', users.create_logout_url(request.path)) + if not context.get('sidebar_menu_html'): + # pass the currently constructed context as keyword arguments to + # all of the sidebar builder functions + context['sidebar_menu_html'] = str(html_menu.UlMenu( + sidebar.buildSidebar(**context))) + return context