diff --git a/colab/proxy/gitlab/apps.py b/colab/proxy/gitlab/apps.py index 5e89f7b..8719018 100644 --- a/colab/proxy/gitlab/apps.py +++ b/colab/proxy/gitlab/apps.py @@ -9,7 +9,7 @@ class ProxyGitlabAppConfig(ColabProxiedAppConfig): verbose_name = 'Gitlab Proxy' menu = { - 'title': _('Repository'), + 'title': _('Code'), 'links': ( (_('Public Projects'), 'public/projects'), ), diff --git a/colab/proxy/templatetags/proxy.py b/colab/proxy/templatetags/proxy.py index 0faa9a9..cfddd74 100644 --- a/colab/proxy/templatetags/proxy.py +++ b/colab/proxy/templatetags/proxy.py @@ -20,7 +20,7 @@ PROXY_MENU_ITEM_TEMPLATE = """ @register.simple_tag(takes_context=True) def proxy_menu(context): - menu = '' + menu_links = {} proxied_apps = context.get('proxy', {}) for app in proxied_apps.values(): @@ -35,11 +35,19 @@ def proxy_menu(context): if not links: continue - items = '' + if title not in menu_links: + menu_links[title] = [] for text, link in links: url = reverse(app.label, args=(link,)) - items += PROXY_MENU_ITEM_TEMPLATE.format(link=url, + menu_links[title].append((text, url)) + + menu = '' + + for title, links in menu_links.items(): + items = '' + for text, link in links: + items += PROXY_MENU_ITEM_TEMPLATE.format(link=link, link_title=unicode(text)) menu += PROXY_MENU_TEMPLATE.format(title=unicode(title), items=items) diff --git a/colab/proxy/trac/apps.py b/colab/proxy/trac/apps.py index 9b8436c..d54d8bb 100644 --- a/colab/proxy/trac/apps.py +++ b/colab/proxy/trac/apps.py @@ -9,7 +9,7 @@ class ProxyTracAppConfig(ColabProxiedAppConfig): verbose_name = 'Trac Proxy' menu = { - 'title': _('Contribute'), + 'title': _('Code'), 'links': ( (_('Timeline'), 'timeline'), (_('Wiki'), 'wiki'), -- libgit2 0.21.2