app/soc/views/models/club_app.py
changeset 970 8b5611d5b053
parent 944 5ea2bd9e3fa6
child 986 e9611a2288ca
equal deleted inserted replaced
969:b12de918d660 970:8b5611d5b053
    22     '"Lennard de Rijk" <ljvderijk@gmail.com>',
    22     '"Lennard de Rijk" <ljvderijk@gmail.com>',
    23   ]
    23   ]
    24 
    24 
    25 
    25 
    26 from django import forms
    26 from django import forms
    27 from django.utils.translation import ugettext_lazy
    27 from django.utils.translation import ugettext
    28 
    28 
    29 from soc.logic import accounts
    29 from soc.logic import accounts
    30 from soc.logic import cleaning
    30 from soc.logic import cleaning
    31 from soc.logic import dicts
    31 from soc.logic import dicts
    32 from soc.logic.helper import notifications
    32 from soc.logic.helper import notifications
   130     # get all the pending applications
   130     # get all the pending applications
   131 
   131 
   132     pa_params = params.copy() # pending applications
   132     pa_params = params.copy() # pending applications
   133 
   133 
   134     if is_developer:
   134     if is_developer:
   135       pa_params['list_description'] = ugettext_lazy(
   135       pa_params['list_description'] = ugettext(
   136           "An overview of all pending club applications.")
   136           "An overview of all pending club applications.")
   137     else:
   137     else:
   138       pa_params['list_description'] = ugettext_lazy(
   138       pa_params['list_description'] = ugettext(
   139           "An overview of your pending club applications.")
   139           "An overview of your pending club applications.")
   140 
   140 
   141     pa_list = list_helper.getListContent(
   141     pa_list = list_helper.getListContent(
   142         request, pa_params, filter, 0)
   142         request, pa_params, filter, 0)
   143 
   143 
   147     filter['status'] = 'accepted'
   147     filter['status'] = 'accepted'
   148 
   148 
   149     aa_params = params.copy() # accepted applications
   149     aa_params = params.copy() # accepted applications
   150 
   150 
   151     if is_developer:
   151     if is_developer:
   152       aa_params['list_description'] = ugettext_lazy(
   152       aa_params['list_description'] = ugettext(
   153           "An overview of all accepted club applications.")
   153           "An overview of all accepted club applications.")
   154     else:
   154     else:
   155       aa_params['list_description'] = ugettext_lazy(
   155       aa_params['list_description'] = ugettext(
   156           "An overview of your accepted club applications.")
   156           "An overview of your accepted club applications.")
   157 
   157 
   158     aa_params['url_name'] = 'club'
   158     aa_params['url_name'] = 'club'
   159     aa_params['list_action'] = (redirects.getApplicantRedirect, aa_params)
   159     aa_params['list_action'] = (redirects.getApplicantRedirect, aa_params)
   160 
   160 
   167     filter['status'] = 'rejected'
   167     filter['status'] = 'rejected'
   168 
   168 
   169     da_params = params.copy() # denied applications
   169     da_params = params.copy() # denied applications
   170 
   170 
   171     if is_developer:
   171     if is_developer:
   172       da_params['list_description'] = ugettext_lazy(
   172       da_params['list_description'] = ugettext(
   173           "An overview of all denied club applications.")
   173           "An overview of all denied club applications.")
   174     else:
   174     else:
   175       da_params['list_description'] = ugettext_lazy(
   175       da_params['list_description'] = ugettext(
   176           "An overview of your denied club applications.")
   176           "An overview of your denied club applications.")
   177 
   177 
   178     da_list = list_helper.getListContent(
   178     da_list = list_helper.getListContent(
   179         request, da_params, filter, 2)
   179         request, da_params, filter, 2)
   180 
   180 
   184       # re use the old filter, but this time only for ignored apps
   184       # re use the old filter, but this time only for ignored apps
   185       filter['status'] = 'ignored'
   185       filter['status'] = 'ignored'
   186 
   186 
   187       ia_params = params.copy() # ignored applications
   187       ia_params = params.copy() # ignored applications
   188 
   188 
   189       ia_params['list_description'] = ugettext_lazy(
   189       ia_params['list_description'] = ugettext(
   190           "An overview of all ignored club applications.")
   190           "An overview of all ignored club applications.")
   191 
   191 
   192       ia_list = list_helper.getListContent(
   192       ia_list = list_helper.getListContent(
   193           request, ia_params, filter, 3)
   193           request, ia_params, filter, 3)
   194 
   194 
   287 
   287 
   288     # only select the requests that haven't been reviewed yet
   288     # only select the requests that haven't been reviewed yet
   289     filter = {'status' : 'needs review'}
   289     filter = {'status' : 'needs review'}
   290 
   290 
   291     ur_params = params.copy()
   291     ur_params = params.copy()
   292     ur_params['list_description'] = ugettext_lazy('A list of all unhandled '
   292     ur_params['list_description'] = ugettext('A list of all unhandled '
   293         'applications.')
   293         'applications.')
   294     ur_params ['list_action'] = (redirects.getReviewRedirect, params)
   294     ur_params ['list_action'] = (redirects.getReviewRedirect, params)
   295 
   295 
   296     ur_list = helper.lists.getListContent(
   296     ur_list = helper.lists.getListContent(
   297         request, ur_params, filter, 0)
   297         request, ur_params, filter, 0)
   298 
   298 
   299     # only select the requests that haven't been turned into a group yet
   299     # only select the requests that haven't been turned into a group yet
   300     filter['status'] = 'accepted'
   300     filter['status'] = 'accepted'
   301 
   301 
   302     uh_params = params.copy()
   302     uh_params = params.copy()
   303     uh_params['list_description'] = ugettext_lazy('A list of all applications '
   303     uh_params['list_description'] = ugettext('A list of all applications '
   304         'that have been accepted but not turned into a Club yet')
   304         'that have been accepted but not turned into a Club yet')
   305     uh_params ['list_action'] = (redirects.getReviewRedirect, params)
   305     uh_params ['list_action'] = (redirects.getReviewRedirect, params)
   306 
   306 
   307     uh_list = helper.lists.getListContent(
   307     uh_list = helper.lists.getListContent(
   308         request, uh_params, filter, 1)
   308         request, uh_params, filter, 1)
   309 
   309 
   310     # only select the requests the have been rejected
   310     # only select the requests the have been rejected
   311     filter ['status'] = 'rejected'
   311     filter ['status'] = 'rejected'
   312 
   312 
   313     den_params = params.copy()
   313     den_params = params.copy()
   314     den_params['list_description'] = ugettext_lazy('A list of all applications '
   314     den_params['list_description'] = ugettext('A list of all applications '
   315         'that have been rejected')
   315         'that have been rejected')
   316     den_params ['list_action'] = (redirects.getReviewRedirect, params)
   316     den_params ['list_action'] = (redirects.getReviewRedirect, params)
   317 
   317 
   318     den_list = helper.lists.getListContent(
   318     den_list = helper.lists.getListContent(
   319         request, den_params, filter, 2)
   319         request, den_params, filter, 2)
   320 
   320 
   321     # only select the request that have been ignored
   321     # only select the request that have been ignored
   322     filter ['status'] = 'ignored'
   322     filter ['status'] = 'ignored'
   323 
   323 
   324     ign_params = params.copy()
   324     ign_params = params.copy()
   325     ign_params['list_description'] = ugettext_lazy('A list of all applications '
   325     ign_params['list_description'] = ugettext('A list of all applications '
   326         'that have been ignored')
   326         'that have been ignored')
   327     ign_params ['list_action'] = (redirects.getReviewRedirect, params)
   327     ign_params ['list_action'] = (redirects.getReviewRedirect, params)
   328 
   328 
   329     ign_list = helper.lists.getListContent(
   329     ign_list = helper.lists.getListContent(
   330         request, ign_params, filter, 3)
   330         request, ign_params, filter, 3)