Example #1
0
def jquery_clear_preferred_view(context, request):
    request.response.cache_expires = 0
    communities_folder = find_communities(context)
    set_preferred_communities(communities_folder, request, None)
    updated_communities = get_my_communities(communities_folder, request)
    return {'api': TemplateAPI(context, request),
            'my_communities': updated_communities,
            'preferred': None,
            'show_all': False,
            'profile': None,
            'status_message': _(u'Cleared preferred communities.')}
Example #2
0
def jquery_set_preferred_view(context, request):
    request.response.cache_expires = 0
    communities_folder = find_communities(context)
    communities = request.params.getall('preferred[]')
    set_preferred_communities(communities_folder, request, communities)
    updated_communities = get_my_communities(communities_folder, request)
    return {'api': TemplateAPI(context, request),
            'my_communities': updated_communities,
            'preferred': communities,
            'show_all': False,
            'profile': None,
            'status_message': _(u'Set preferred communities.')}
 def _callFUT(self, context, request, communities):
     from karl.views.communities import set_preferred_communities
     set_preferred_communities(context, request, communities)
Example #4
0
 def _callFUT(self, context, request, communities):
     from karl.views.communities import set_preferred_communities
     set_preferred_communities(context, request, communities)