Commit ca0bfd33 by Kálmán Viktor

dashboard: make lease list table sortable

parent 488ec536
......@@ -250,11 +250,11 @@ class LeaseListTable(Table):
args=[A('pk')],
)
suspend_in = TemplateColumn(
suspend_interval_seconds = TemplateColumn(
"{{ record.get_readable_suspend_time }}"
)
delete_in = TemplateColumn(
delete_interval_seconds = TemplateColumn(
"{{ record.get_readable_delete_time }}"
)
......@@ -268,5 +268,6 @@ class LeaseListTable(Table):
model = Lease
attrs = {'class': ('table table-bordered table-striped table-hover'
' lease-list-table')}
fields = ('name', 'suspend_in', 'delete_in', )
fields = ('name', 'suspend_interval_seconds',
'delete_interval_seconds', )
prefix = "lease-"
......@@ -916,7 +916,8 @@ class TemplateList(LoginRequiredMixin, SingleTableView):
def get_context_data(self, *args, **kwargs):
context = super(TemplateList, self).get_context_data(*args, **kwargs)
context['lease_table'] = LeaseListTable(Lease.objects.all())
context['lease_table'] = LeaseListTable(Lease.objects.all(),
request=self.request)
return context
def get_queryset(self):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment