Commit 7b84eaf8 by Őry Máté

dashboard: add activity icons to context

parent 62303312
...@@ -309,7 +309,7 @@ class VmDetailView(CheckedDetailView): ...@@ -309,7 +309,7 @@ class VmDetailView(CheckedDetailView):
activities = instance.get_merged_activities(user) activities = instance.get_merged_activities(user)
show_show_all = len(activities) > 10 show_show_all = len(activities) > 10
activities = activities[:10] activities = activities[:10]
context['activities'] = activities context['activities'] = _format_activities(activities)
context['show_show_all'] = show_show_all context['show_show_all'] = show_show_all
latest = instance.get_latest_activity_in_progress() latest = instance.get_latest_activity_in_progress()
context['is_new_state'] = (latest and context['is_new_state'] = (latest and
...@@ -2501,7 +2501,8 @@ def vm_activity(request, pk): ...@@ -2501,7 +2501,8 @@ def vm_activity(request, pk):
response = {} response = {}
show_all = request.GET.get("show_all", "false") == "true" show_all = request.GET.get("show_all", "false") == "true"
activities = instance.get_merged_activities(request.user) activities = _format_activities(
instance.get_merged_activities(request.user))
show_show_all = len(activities) > 10 show_show_all = len(activities) > 10
if not show_all: if not show_all:
activities = activities[:10] activities = activities[:10]
...@@ -2982,8 +2983,9 @@ class InstanceActivityDetail(CheckedDetailView): ...@@ -2982,8 +2983,9 @@ class InstanceActivityDetail(CheckedDetailView):
def get_context_data(self, **kwargs): def get_context_data(self, **kwargs):
ctx = super(InstanceActivityDetail, self).get_context_data(**kwargs) ctx = super(InstanceActivityDetail, self).get_context_data(**kwargs)
ctx['activities'] = self.object.instance.get_activities( ctx['activities'] = _format_activities(
self.request.user) self.object.instance.get_activities(self.request.user))
ctx['icon'] = _get_activity_icon(self.object)
return ctx return ctx
......
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