Add support for sortable columns
Add a new argument to the SourceColumn class to flag a column as sortable. The SourceColum will generate a request querystring to be used as the table header archor href. The SingleObjectListView will capture the querystring and call the order_by on the queryset to sort it. Signed-off-by: Roberto Rosario <Roberto.Rosario@mayan-edms.com>
This commit is contained in:
@@ -84,6 +84,7 @@ class DocumentListView(SingleObjectListView):
|
||||
def get_extra_context(self):
|
||||
return {
|
||||
'hide_links': True,
|
||||
'hide_object': True,
|
||||
'list_as_items': True,
|
||||
'no_results_icon': icon_document_list,
|
||||
'no_results_text': _(
|
||||
@@ -963,9 +964,6 @@ class RecentAddedDocumentListView(DocumentListView):
|
||||
context = super(RecentAddedDocumentListView, self).get_extra_context()
|
||||
context.update(
|
||||
{
|
||||
'extra_columns': (
|
||||
{'name': _('Added'), 'attribute': 'date_added'},
|
||||
),
|
||||
'no_results_icon': icon_document_list_recent_added,
|
||||
'no_results_text': _(
|
||||
'This view will list the latest documents uploaded '
|
||||
|
||||
Reference in New Issue
Block a user