Commit 154902de by Őry Máté

Merge branch 'master' into feature-refactor-views

Conflicts:
	circle/dashboard/views.py
parents 2fd40158 753691c4
...@@ -234,6 +234,7 @@ $(function () { ...@@ -234,6 +234,7 @@ $(function () {
'host': result[i].host, 'host': result[i].host,
'icon': result[i].icon, 'icon': result[i].icon,
'status': result[i].status, 'status': result[i].status,
'owner': result[i].owner,
}); });
} }
}); });
...@@ -251,7 +252,7 @@ $(function () { ...@@ -251,7 +252,7 @@ $(function () {
search_result.sort(compareVmByFav); search_result.sort(compareVmByFav);
for(var i=0; i<5 && i<search_result.length; i++) for(var i=0; i<5 && i<search_result.length; i++)
html += generateVmHTML(search_result[i].pk, search_result[i].name, html += generateVmHTML(search_result[i].pk, search_result[i].name,
search_result[i].host, search_result[i].icon, search_result[i].owner ? search_result[i].owner : search_result[i].host, search_result[i].icon,
search_result[i].status, search_result[i].fav, search_result[i].status, search_result[i].fav,
(search_result.length < 5)); (search_result.length < 5));
if(search_result.length == 0) if(search_result.length == 0)
......
...@@ -25,7 +25,10 @@ ...@@ -25,7 +25,10 @@
<i class="fa {{ i.get_status_icon }}" title="{{ i.get_status_display }}"></i> <i class="fa {{ i.get_status_icon }}" title="{{ i.get_status_display }}"></i>
{{ i.name }} {{ i.name }}
</span> </span>
<small class="text-muted"> {{ i.short_hostname }}</small> <small class="text-muted">
{% if i.owner == request.user %}{{ i.short_hostname }}
{% else %}{{i.owner.profile.get_display_name}}{% endif %}
</small>
<div class="pull-right dashboard-vm-favourite" data-vm="{{ i.pk }}"> <div class="pull-right dashboard-vm-favourite" data-vm="{{ i.pk }}">
{% if i.fav %} {% if i.fav %}
<i class="fa fa-star text-primary title-favourite" title="{% trans "Unfavourite" %}"></i> <i class="fa fa-star text-primary title-favourite" title="{% trans "Unfavourite" %}"></i>
......
...@@ -796,6 +796,8 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView): ...@@ -796,6 +796,8 @@ class VmList(LoginRequiredMixin, FilterMixin, ListView):
'icon': i.get_status_icon(), 'icon': i.get_status_icon(),
'host': i.short_hostname, 'host': i.short_hostname,
'status': i.get_status_display(), 'status': i.get_status_display(),
'owner': (i.owner.profile.get_display_name()
if i.owner != self.request.user else None),
'fav': i.pk in favs, 'fav': i.pk in favs,
} for i in instances] } for i in instances]
return HttpResponse( return HttpResponse(
...@@ -1377,6 +1379,7 @@ class TransferOwnershipConfirmView(LoginRequiredMixin, View): ...@@ -1377,6 +1379,7 @@ class TransferOwnershipConfirmView(LoginRequiredMixin, View):
old = instance.owner old = instance.owner
with instance_activity(code_suffix='ownership-transferred', with instance_activity(code_suffix='ownership-transferred',
concurrency_check=False,
instance=instance, user=request.user): instance=instance, user=request.user):
instance.owner = request.user instance.owner = request.user
instance.clean() instance.clean()
......
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