diff --git a/colab/proxy/noosfero/apps.py b/colab/proxy/noosfero/apps.py index bb9e75f..03d9458 100644 --- a/colab/proxy/noosfero/apps.py +++ b/colab/proxy/noosfero/apps.py @@ -15,7 +15,9 @@ class ProxyNoosferoAppConfig(ColabProxiedAppConfig): (_('Communities'), 'search/communities'), ), 'auth_links': ( - (_('Profile'), 'profile'), - (_('Control panel'), 'myprofile'), + (_('Profile'), 'profile/{0}'), + (_('Control panel'), 'myprofile/{0}'), ), } + + arguments = ["context['user']"] diff --git a/colab/proxy/templatetags/proxy.py b/colab/proxy/templatetags/proxy.py index 9b83a34..886f82c 100644 --- a/colab/proxy/templatetags/proxy.py +++ b/colab/proxy/templatetags/proxy.py @@ -37,8 +37,17 @@ def proxy_menu(context): if title not in menu_links: menu_links[title] = [] + is_authenticated = context['request'].user.is_authenticated() + if hasattr(app, 'arguments') and is_authenticated: + arguments = app.arguments + else: + arguments = [] + + for i, _ in enumerate(arguments): + arguments[i] = eval(arguments[i]) + for text, link in links: - url = reverse(app.label, args=(link,)) + url = reverse(app.label, args=(link.format(*arguments),)) menu_links[title].append((text, url)) menu = render_to_string('proxy/menu_template.html', -- libgit2 0.21.2