125 'soc.views.models.%s.edit', 'Edit %(name_short)s'), |
125 'soc.views.models.%s.edit', 'Edit %(name_short)s'), |
126 (r'^%(url_name)s/list$', |
126 (r'^%(url_name)s/list$', |
127 'soc.views.models.%s.list', 'List %(name_plural)s'), |
127 'soc.views.models.%s.list', 'List %(name_plural)s'), |
128 ] |
128 ] |
129 |
129 |
130 new_params['list_redirect_action'] = '/' + params['url_name'] + '/edit' |
130 new_params['edit_template'] = 'soc/models/edit.html' |
|
131 new_params['list_template'] = 'soc/models/list.html' |
|
132 new_params['invite_template'] = 'soc/models/invite.html' |
|
133 |
|
134 new_params['list_main'] = 'soc/list/list_main.html' |
|
135 new_params['list_pagination'] = 'soc/list/list_pagination.html' |
|
136 |
|
137 new_params['list_action'] = '/' + params['url_name'] + '/edit' |
|
138 new_params['list_params'] = { |
|
139 'list_action': 'action', |
|
140 'list_description': 'description', |
|
141 'list_main': 'main', |
|
142 'list_pagination': 'pagination', |
|
143 'list_row': 'row', |
|
144 'list_heading': 'heading', |
|
145 } |
131 |
146 |
132 description = ugettext_lazy('List of %(name)s in Google Open Source Programs.') |
147 description = ugettext_lazy('List of %(name)s in Google Open Source Programs.') |
133 new_params['list_description'] = description % params |
148 new_params['list_description'] = description % params |
134 new_params['save_message'] = [ugettext_lazy('Profile saved.')] |
149 new_params['save_message'] = [ugettext_lazy('Profile saved.')] |
135 new_params['edit_params'] = { |
150 new_params['edit_params'] = { |
356 else: |
371 else: |
357 entities = self._logic.getForFields(filter, limit=limit+1, offset=offset) |
372 entities = self._logic.getForFields(filter, limit=limit+1, offset=offset) |
358 |
373 |
359 context['pagination_form'] = helper.lists.makePaginationForm(request, limit) |
374 context['pagination_form'] = helper.lists.makePaginationForm(request, limit) |
360 |
375 |
361 templates = params['lists_template'] |
376 updates = dicts.rename(params, params['list_params']) |
362 description = params['list_description'] |
377 updates['logic'] = self._logic |
363 |
378 |
364 content = helper.lists.getList(request, entities, templates, |
379 content = helper.lists.getList(request, entities, offset, limit) |
365 description, offset, limit) |
380 content.update(updates) |
|
381 |
366 context['list'] = soc.logic.lists.Lists([content]) |
382 context['list'] = soc.logic.lists.Lists([content]) |
367 |
383 |
368 context['entity_type'] = params['name'] |
384 context['entity_type'] = params['name'] |
369 context['entity_type_plural'] = params['name_plural'] |
385 context['entity_type_plural'] = params['name_plural'] |
370 context['redirect_action'] = params['list_redirect_action'] |
|
371 |
386 |
372 template = params['list_template'] |
387 template = params['list_template'] |
373 |
388 |
374 return helper.responses.respond(request, template, context) |
389 return helper.responses.respond(request, template, context) |
375 |
390 |