Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
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
Show 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() {
});
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):
name
=
LinkColumn
(
'dashboard.views.template-detail'
,
args
=
[
A
(
'pk'
)],
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
num_cores
=
Column
(
verbose_name
=
_
(
"Cores"
),
attrs
=
{
'th'
:
{
'data-sort'
:
"int"
}}
)
ram_size
=
TemplateColumn
(
"{{ record.ram_size }} Mb"
,
attrs
=
{
'th'
:
{
'data-sort'
:
"string"
}}
)
lease
=
TemplateColumn
(
"{{ record.lease.name }}"
,
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
(
verbose_name
=
_
(
"Actions"
),
...
...
circle/dashboard/templates/dashboard/template-list.html
View file @
488ec536
...
...
@@ -55,5 +55,6 @@
{% endblock %}
{% 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 %}
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