Esempio n. 1
0
def resources(request, site, tag_string='', type='other', template_name='plus_explore/explore_filtered.html', current_app='plus_groups'):
    form = SearchForm(request.GET)
    if form.is_valid():
        search, order = set_search_order(request, form)
    else:
        search = ''
        search_type = ''
 

    head_title = _('Resources')
    type_name = "Resource"

    # hmm shouldn't we just use current app to determine search_types?        
    search_types = narrow_search_types(type_name) 
    side_search = side_search_args('resources', search_types[0][1][2])

    listing_args_dict = listing_args('resources', 'resources_tag', tag_string=tag_string, search_terms=search, multitabbed=False, order=order, template_base="site_base.html", search_type_label=head_title)
    search_dict = plus_search(listing_args_dict['tag_filter'], search, search_types, order)
    
    return render_to_response(template_name, 
                              {'head_title':head_title,
                               'search':search_dict,
                               'listing_args':listing_args_dict,
                               'search_args':side_search,
                               "obj_type": type_name,
                               'intro_box_override':True}, 
                              context_instance=RequestContext(request,
                                                              current_app=current_app))
Esempio n. 2
0
 def _subsearch(request, group, tag_string='', current_app='plus_groups',  
                template_name='plus_explore/explore_filtered.html', **kwargs) :
     form=SearchForm(request.GET)
     if form.is_valid():
         search, order = set_search_order(request, form)
     else:
         # what should we do here?
         raise Exception('Search form is invalid')
     search_and_listing_args_dict = f(request, group, tag_string, search, order, current_app=current_app, **kwargs)
     return render_to_response(template_name, search_and_listing_args_dict, 
                               context_instance=RequestContext(request, current_app=current_app))
Esempio n. 3
0
def groups(request, site, tag_string='', type='other', template_name='plus_explore/explore_filtered.html', current_app='plus_groups'):
    form = SearchForm(request.GET)
    if form.is_valid():
        search, order = set_search_order(request, form)
    else:
        search = ''
        search_type = ''

    create_group = False
    if request.user.is_authenticated():

        try:
            if current_app == 'groups':
                site.create_virtual
            else :
                site.create_hub
            create_group = True
        except Exception, e:
            print "User can't create a group",e
Esempio n. 4
0
def resources(request,
              site,
              tag_string='',
              type='other',
              template_name='plus_explore/explore_filtered.html',
              current_app='plus_groups'):
    form = SearchForm(request.GET)
    if form.is_valid():
        search, order = set_search_order(request, form)
    else:
        search = ''
        search_type = ''

    head_title = _('Resources')
    type_name = "Resource"

    # hmm shouldn't we just use current app to determine search_types?
    search_types = narrow_search_types(type_name)
    side_search = side_search_args('resources', search_types[0][1][2])

    listing_args_dict = listing_args('resources',
                                     'resources_tag',
                                     tag_string=tag_string,
                                     search_terms=search,
                                     multitabbed=False,
                                     order=order,
                                     template_base="site_base.html",
                                     search_type_label=head_title)
    search_dict = plus_search(listing_args_dict['tag_filter'], search,
                              search_types, order)

    return render_to_response(template_name, {
        'head_title': head_title,
        'search': search_dict,
        'listing_args': listing_args_dict,
        'search_args': side_search,
        "obj_type": type_name,
        'intro_box_override': True
    },
                              context_instance=RequestContext(
                                  request, current_app=current_app))
Esempio n. 5
0
def profiles(request, tag_string='', template_name="plus_explore/explore_filtered.html"):
    form = SearchForm(request.GET)
    if form.is_valid():
        search, order = set_search_order(request, form)
    else:
        search = ''
        order = ''

    search_types = narrow_search_types()
    side_search = side_search_args('profile_list', search_types[0][1][2])

    head_title = _('Members')
    listing_args_dict = listing_args('profile_list', 'profile_list_tag', tag_string=tag_string, search_terms=search, multitabbed=False, order=order, template_base="site_base.html", search_type_label=head_title)
    search_dict = plus_search(listing_args_dict['tag_filter'], search, search_types, order)

    #users = users.filter(~Q(username='******')).filter(~Q(username='******')).filter(~Q(username='******'))
    return render_to_response(template_name, {'head_title':head_title, 
                                              'listing_args':listing_args_dict,
                                              'search_args':side_search,
                                              'search':search_dict,
                                              'intro_box_override':True}, context_instance=RequestContext(request))