app/soc/views/site/user/list.py
changeset 265 3c2994f3b85f
parent 263 9b39d93b677f
child 266 3b47bfd4f1b3
equal deleted inserted replaced
264:97b60788cb9a 265:3c2994f3b85f
    50   alt_response = simple.getAltResponseIfNotDeveloper(request,
    50   alt_response = simple.getAltResponseIfNotDeveloper(request,
    51                                                      context=context)
    51                                                      context=context)
    52   if alt_response:
    52   if alt_response:
    53     return alt_response  
    53     return alt_response  
    54   
    54   
    55   offset = request.GET.get('offset')
    55   offset, limit = list_helpers.cleanListParameters(
    56   limit = request.GET.get('limit')
    56       offset=request.GET.get('offset'), limit=request.GET.get('limit'))
    57 
       
    58   offset, limit = list_helpers.getListParemeters(offset=offset, limit=limit)
       
    59 
    57 
    60   # Fetch one more to see if there should be a 'next' link
    58   # Fetch one more to see if there should be a 'next' link
    61   users = id_user.getUsersForLimitAndOffset(limit + 1, offset=offset)
    59   users = id_user.getUsersForLimitAndOffset(limit + 1, offset=offset)
    62 
    60 
    63   # TODO(tlarsen): uncomment when pagination select control is working.
    61   context['pagination_form'] = list_helpers.makePaginationForm(request, limit)
    64   # form = list_helpers.makeSelectNumItemsForm(request, limit)
       
    65   # context['form'] = form
       
    66   
    62   
    67   list_templates = {'list_main': 'soc/list/list_main.html',
    63   list_templates = {'list_main': 'soc/list/list_main.html',
    68                     'list_pagination': 'soc/list/list_pagination.html',
    64                     'list_pagination': 'soc/list/list_pagination.html',
    69                     'list_row': 'soc/site/user/list/user_row.html',
    65                     'list_row': 'soc/site/user/list/user_row.html',
    70                     'list_heading': 'soc/site/user/list/user_heading.html'}
    66                     'list_heading': 'soc/site/user/list/user_heading.html'}