Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gutyán Gábor
/
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
d97f372d
authored
Oct 07, 2013
by
Kálmán Viktor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: display corrent number of remaining vms on index
parent
fe85e03a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
circle/dashboard/templates/dashboard/index-vm.html
+5
-1
circle/dashboard/views.py
+6
-1
No files found.
circle/dashboard/templates/dashboard/index-vm.html
View file @
d97f372d
...
...
@@ -27,7 +27,11 @@
</div>
</div>
<div
class=
"col-sm-6 text-right"
>
<a
class=
"btn btn-primary btn-xs"
href=
"{% url "
dashboard
.
views
.
vm-list
"
%}"
><i
class=
"icon-chevron-sign-right"
></i>
<strong>
13
</strong>
more
</a>
{% if more_instances > 0 %}
<a
class=
"btn btn-primary btn-xs"
href=
"{% url "
dashboard
.
views
.
vm-list
"
%}"
>
<i
class=
"icon-chevron-sign-right"
></i>
<strong>
{{ more_instances }}
</strong>
more
</a>
{% endif %}
<a
class=
"btn btn-success btn-xs"
><i
class=
"icon-plus-sign"
></i>
new
</a>
</div>
</div>
...
...
circle/dashboard/views.py
View file @
d97f372d
...
...
@@ -16,9 +16,14 @@ class IndexView(TemplateView):
else
:
user
=
None
instances
=
Instance
.
objects
.
filter
(
owner
=
user
)
context
=
super
(
IndexView
,
self
)
.
get_context_data
(
**
kwargs
)
context
.
update
({
'instances'
:
Instance
.
objects
.
filter
(
owner
=
user
)[:
5
],
'instances'
:
instances
[:
5
],
})
context
.
update
({
'more_instances'
:
instances
.
count
()
-
len
(
instances
[:
5
])
})
return
context
...
...
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