diff --git a/colab/plugins/noosfero/static/noosfero/js/colab_integration.js b/colab/plugins/noosfero/static/noosfero/js/colab_integration.js index b72e571..da6250f 100644 --- a/colab/plugins/noosfero/static/noosfero/js/colab_integration.js +++ b/colab/plugins/noosfero/static/noosfero/js/colab_integration.js @@ -20,12 +20,12 @@ function transform_tags() function feed_gitlab_tag() { - var $tag = $('#activity-tab'); + var $tag = $('#repository-feed-tab'); $tag.text("Esta comunidade não está associada a"+ " nenhum repositório no momento, para mais"+ - " detalhes contacte o administrador"); + " detalhes contate o administrador"); $.getJSON(repository, {limit:activities_limit, offset:0},function(msg, e){ - $tag.html(msg.html); + $tag.html(msg.html); }); } diff --git a/colab/plugins/noosfero/views.py b/colab/plugins/noosfero/views.py index 6e68840..4bf8842 100644 --- a/colab/plugins/noosfero/views.py +++ b/colab/plugins/noosfero/views.py @@ -4,6 +4,7 @@ from django.conf import settings from colab.plugins.views import ColabProxyView from colab_spb.models import CommunityAssociations + class NoosferoProxyView(ColabProxyView): app_label = 'noosfero' diazo_theme_template = 'proxy/noosfero.html' @@ -12,23 +13,36 @@ class NoosferoProxyView(ColabProxyView): ) def dispatch(self, request, *args, **kwargs): - return super(NoosferoProxyView, self).dispatch(request, - *args, **kwargs) - - def set_current_community_association(self, context): - community = self.request.path.split('/')[2] - - if not community: - return - - associations = CommunityAssociations.objects.all() - - for community_association in associations: - if community_association.community.name in community: - context['community_association'] = { - 'community': community_association.community.name, - 'repository': community_association.group.url, - 'mailman_list': community_association.mail_list.name, - 'list_limit': 7, - 'activities_limit': 7, - } + return super(NoosferoProxyView, self).dispatch(request, + *args, **kwargs) + + def get_context_data(self, **kwargs): + context = super(NoosferoProxyView, self).get_context_data(**kwargs) + + community = self.get_community_name(self.request.path) + + if community is "": + return + + associations = CommunityAssociations.objects.all() + + for community_association in associations: + if community_association.community.name in community: + context['community_association'] = { + 'community': community_association.community.name, + 'repository': community_association.group.url, + 'mailman_list': community_association.mail_list.name, + 'list_limit': 7, + 'activities_limit': 7, + } + return context + + def get_community_name(self, path): + community = "" + words = self.request.path.split('/') + + for index in range(len(words)): + if 'profile' in words[index]: + community = words[index+1] + break + return community -- libgit2 0.21.2