Skip to content

Commit

Permalink
WIP:BUILD; Sidebar visualization fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Alejolonber25 committed May 6, 2024
1 parent 45f3395 commit a602703
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% load static %}

{% if actualgroup != "external" %}
<ul class="navbar-nav bg-gradient-primary sidebar sidebar-dark accordion" id="accordionSidebar">

<!-- Sidebar - Brand -->
Expand Down Expand Up @@ -44,4 +44,5 @@
</div>


</ul>
</ul>
{% endif %}
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,8 @@ class ExternalUserDashboardView(TemplateView):
@method_decorator(role_and_login_required)
def dispatch(self, *args, **kwargs):
return super().dispatch(*args, **kwargs)

def get_context_data(self, **kwargs):
context = super().get_context_data(**kwargs)
context['actualgroup'] = 'external'
return context
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@ def dispatch(self, request, *args, **kwargs):
manager_metrics = get_manager_metrics()
leader_metrics = get_leader_metrics()
average_duration = get_average_duration()
group = {'actualgroup': 'other'}
if self.request.user.groups.first().name == 'admin':
group = {'actualgroup': 'admin'}

# Pass metrics as context to template
return render(request, self.template_name, manager_metrics|leader_metrics|average_duration)
return render(request, self.template_name, manager_metrics|leader_metrics|average_duration|group)

0 comments on commit a602703

Please sign in to comment.