Add new list templates toolbar
Add the new generic list and generic list items toolbar which allow switching the list display mode. This toolbar also includes a stylized button to select and deselect all items emulating the check-all checkbox. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -498,6 +498,18 @@ class SingleObjectListView(PaginationMixin, ViewPermissionCheckMixin, ObjectList
|
||||
|
||||
return result
|
||||
|
||||
def get_context_data(self, **kwargs):
|
||||
context = super(SingleObjectListView, self).get_context_data(**kwargs)
|
||||
if context.get('list_as_items'):
|
||||
default_mode = 'items'
|
||||
else:
|
||||
default_mode = 'list'
|
||||
|
||||
list_mode = self.request.GET.get('_list_mode', default_mode)
|
||||
|
||||
context.update({'list_as_items': list_mode=='items'})
|
||||
return context
|
||||
|
||||
def get_paginate_by(self, queryset):
|
||||
return setting_paginate_by.value
|
||||
|
||||
|
||||
Reference in New Issue
Block a user