Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
488ec536
authored
Apr 29, 2014
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: sort template list
parent
2f256c1b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
32 additions
and
1 deletions
+32
-1
circle/dashboard/static/dashboard/template-list.js
+17
-0
circle/dashboard/tables.py
+13
-0
circle/dashboard/templates/dashboard/template-list.html
+2
-1
No files found.
circle/dashboard/static/dashboard/template-list.js
View file @
488ec536
...
@@ -20,6 +20,23 @@ $(function() {
...
@@ -20,6 +20,23 @@ $(function() {
});
});
return
false
;
return
false
;
});
});
/* template table sort */
var
ttable
=
$
(
".template-list-table"
).
stupidtable
();
ttable
.
on
(
"beforetablesort"
,
function
(
event
,
data
)
{
// pass
});
ttable
.
on
(
"aftertablesort"
,
function
(
event
,
data
)
{
$
(
".template-list-table thead th i"
).
remove
();
var
icon_html
=
'<i class="icon-sort-'
+
(
data
.
direction
==
"desc"
?
"up"
:
"down"
)
+
' pull-right" style="position: absolute;"></i>'
;
$
(
".template-list-table thead th"
).
eq
(
data
.
column
).
append
(
icon_html
);
});
// only if js is enabled
$
(
".template-list-table thead th"
).
css
(
"cursor"
,
"pointer"
);
});
});
...
...
circle/dashboard/tables.py
View file @
488ec536
...
@@ -203,16 +203,29 @@ class TemplateListTable(Table):
...
@@ -203,16 +203,29 @@ class TemplateListTable(Table):
name
=
LinkColumn
(
name
=
LinkColumn
(
'dashboard.views.template-detail'
,
'dashboard.views.template-detail'
,
args
=
[
A
(
'pk'
)],
args
=
[
A
(
'pk'
)],
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
)
num_cores
=
Column
(
num_cores
=
Column
(
verbose_name
=
_
(
"Cores"
),
verbose_name
=
_
(
"Cores"
),
attrs
=
{
'th'
:
{
'data-sort'
:
"int"
}}
)
)
ram_size
=
TemplateColumn
(
ram_size
=
TemplateColumn
(
"{{ record.ram_size }} Mb"
,
"{{ record.ram_size }} Mb"
,
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
)
lease
=
TemplateColumn
(
lease
=
TemplateColumn
(
"{{ record.lease.name }}"
,
"{{ record.lease.name }}"
,
verbose_name
=
_
(
"Lease"
),
verbose_name
=
_
(
"Lease"
),
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
arch
=
Column
(
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
system
=
Column
(
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
access_method
=
Column
(
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
)
actions
=
TemplateColumn
(
actions
=
TemplateColumn
(
verbose_name
=
_
(
"Actions"
),
verbose_name
=
_
(
"Actions"
),
...
...
circle/dashboard/templates/dashboard/template-list.html
View file @
488ec536
...
@@ -55,5 +55,6 @@
...
@@ -55,5 +55,6 @@
{% endblock %}
{% endblock %}
{% block extra_js %}
{% block extra_js %}
<script
src=
"{{ STATIC_URL}}dashboard/template-list.js"
></script>
<script
src=
"{{ STATIC_URL}}dashboard/template-list.js"
></script>
<script
src=
"{{ STATIC_URL}}dashboard/js/stupidtable.min.js"
></script>
{% endblock %}
{% endblock %}
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