Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
9a7736ad
authored
Sep 06, 2013
by
Őry Máté
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dashboard: use instance data from models
First try to use dynamic model data instead of dummy static html.
parent
739f0536
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
circle/dashboard/templates/dashboard/index-vm.html
+4
-2
circle/dashboard/views.py
+8
-0
No files found.
circle/dashboard/templates/dashboard/index-vm.html
View file @
9a7736ad
...
@@ -13,9 +13,11 @@
...
@@ -13,9 +13,11 @@
</h3>
</h3>
</div>
</div>
<div
class=
"list-group"
id=
"vm-list-view"
>
<div
class=
"list-group"
id=
"vm-list-view"
>
<a
href=
"vm/442"
class=
"list-group-item"
>
{% for i in instances %}
<i
class=
"icon-play-sign"
></i>
ALMA
<div
class=
"pull-right"
><i
class=
"icon-star text-primary"
title=
"Mark as favorite."
></i></div>
<a
href=
"{% url i %}"
class=
"list-group-item"
>
<i
class=
"icon-play-sign"
></i>
{{ i.name }}
<div
class=
"pull-right"
><i
class=
"icon-star text-primary"
title=
"Mark as favorite."
></i></div>
</a>
</a>
{% endfor %}
<a
href=
"vm/443"
class=
"list-group-item"
>
<a
href=
"vm/443"
class=
"list-group-item"
>
<i
class=
"icon-play-sign"
></i>
ALMA
<div
class=
"pull-right"
><i
class=
"icon-star text-primary"
title=
"Mark as favorite."
></i></div>
<i
class=
"icon-play-sign"
></i>
ALMA
<div
class=
"pull-right"
><i
class=
"icon-star text-primary"
title=
"Mark as favorite."
></i></div>
</a>
</a>
...
...
circle/dashboard/views.py
View file @
9a7736ad
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
from
vm.models
import
Instance
class
IndexView
(
TemplateView
):
class
IndexView
(
TemplateView
):
template_name
=
"dashboard/index.html"
template_name
=
"dashboard/index.html"
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
IndexView
,
self
)
.
get_context_data
(
**
kwargs
)
context
.
update
({
'instances'
:
Instance
.
objects
.
filter
(
owner
=
self
.
request
.
user
),
})
return
context
class
VmDetailView
(
TemplateView
):
class
VmDetailView
(
TemplateView
):
template_name
=
"dashboard/vm-detail.html"
template_name
=
"dashboard/vm-detail.html"
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