Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
ca0bfd33
authored
Apr 29, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: make lease list table sortable
parent
488ec536
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
+6
-4
circle/dashboard/tables.py
+4
-3
circle/dashboard/views.py
+2
-1
No files found.
circle/dashboard/tables.py
View file @
ca0bfd33
...
@@ -250,11 +250,11 @@ class LeaseListTable(Table):
...
@@ -250,11 +250,11 @@ class LeaseListTable(Table):
args
=
[
A
(
'pk'
)],
args
=
[
A
(
'pk'
)],
)
)
suspend_in
=
TemplateColumn
(
suspend_in
terval_seconds
=
TemplateColumn
(
"{{ record.get_readable_suspend_time }}"
"{{ record.get_readable_suspend_time }}"
)
)
delete_in
=
TemplateColumn
(
delete_in
terval_seconds
=
TemplateColumn
(
"{{ record.get_readable_delete_time }}"
"{{ record.get_readable_delete_time }}"
)
)
...
@@ -268,5 +268,6 @@ class LeaseListTable(Table):
...
@@ -268,5 +268,6 @@ class LeaseListTable(Table):
model
=
Lease
model
=
Lease
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover'
attrs
=
{
'class'
:
(
'table table-bordered table-striped table-hover'
' lease-list-table'
)}
' lease-list-table'
)}
fields
=
(
'name'
,
'suspend_in'
,
'delete_in'
,
)
fields
=
(
'name'
,
'suspend_interval_seconds'
,
'delete_interval_seconds'
,
)
prefix
=
"lease-"
prefix
=
"lease-"
circle/dashboard/views.py
View file @
ca0bfd33
...
@@ -916,7 +916,8 @@ class TemplateList(LoginRequiredMixin, SingleTableView):
...
@@ -916,7 +916,8 @@ class TemplateList(LoginRequiredMixin, SingleTableView):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
def
get_context_data
(
self
,
*
args
,
**
kwargs
):
context
=
super
(
TemplateList
,
self
)
.
get_context_data
(
*
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
return
context
def
get_queryset
(
self
):
def
get_queryset
(
self
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment