Commit 9a7736ad by Őry Máté

dashboard: use instance data from models

First try to use dynamic model data instead of dummy static html.
parent 739f0536
...@@ -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>
......
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"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment