diff --git a/colab/plugins/management/commands/import_proxy_data.py b/colab/plugins/management/commands/import_proxy_data.py index 9862654..ff6542d 100644 --- a/colab/plugins/management/commands/import_proxy_data.py +++ b/colab/plugins/management/commands/import_proxy_data.py @@ -17,7 +17,7 @@ class Command(BaseCommand): for module_name in settings.PROXIED_APPS.keys(): module_path = \ - 'colab.plugins.{}.data_api'.format(module_name.split('.')[-1]) + '{}.data_api'.format(module_name.split('.')[-1]) module = importlib.import_module(module_path) for module_item_name in dir(module): diff --git a/colab/search/utils.py b/colab/search/utils.py index 3145dc5..c4e4004 100644 --- a/colab/search/utils.py +++ b/colab/search/utils.py @@ -58,7 +58,7 @@ def get_collaboration_data(logged_user, filter_by_user=None): for app_name in app_names: module = importlib \ - .import_module('colab.plugins.{}.models'.format(app_name)) + .import_module('{}.models'.format(app_name)) for module_item_name in dir(module): module_item = getattr(module, module_item_name) diff --git a/colab/urls.py b/colab/urls.py index 6f39972..cff5a62 100644 --- a/colab/urls.py +++ b/colab/urls.py @@ -36,7 +36,6 @@ urlpatterns = patterns('', url(r'^colab/admin/', include(admin.site.urls)), url(r'^trac/', include('colab.plugins.trac.urls')), - url(r'^gitlab/', include('colab.plugins.gitlab.urls')), url(r'^social/', include('colab.plugins.noosfero.urls')), url(r'^ci/', include('colab.plugins.jenkins.urls')), diff --git a/tests/plugins.d/gitlab.py b/tests/plugins.d/gitlab.py index b0f9cb9..d64cd22 100644 --- a/tests/plugins.d/gitlab.py +++ b/tests/plugins.d/gitlab.py @@ -1,39 +1,23 @@ from django.utils.translation import ugettext_lazy as _ +from colab.plugins.utils.menu import colab_url_factory -name = 'colab.plugins.gitlab' +name = 'colab_gitlab' verbose_name = 'Gitlab Proxy' upstream = 'localhost' #middlewares = [] -menu = { -'title': _('Code'), -'links': ( - (_('Public Projects'), 'public/projects'), -), -'auth_links': ( - (_('Profile'), 'profile'), - (_('New Project'), 'projects/new'), - (_('Projects'), 'dashboard/projects'), - (_('Groups'), 'profile/groups'), - (_('Issues'), 'dashboard/issues'), - (_('Merge Requests'), 'dashboard/merge_requests'), - -), +urls = { + 'include': 'colab_gitlab.urls', + 'namespace': 'gitlab', + 'prefix': 'gitlab', } +menu_title = _('Code') + +url = colab_url_factory('gitlab') -# dpaste: -# dependencies: -# - 'mptt' -# urls: -# include: 'dpaste.urls.dpaste' -# prefix: '^paste/' -# namespace: 'dpaste' -# menu: -# title: 'Dpaste' -# links: -# Public Projects: '/paste' -# auth_links: -# Profile: '/projects' -# New Project: '/projects/new' +menu_urls = ( + url(display=_('Profile'), viewname='gitlab', kwargs={'path': '/profile/anonymous'}, auth=False), + url(display=_('Profile Two'), viewname='gitlab', kwargs={'path': '/profile/logged'}, auth=True), +) -- libgit2 0.21.2