Skip to content

Commit

Permalink
[#156] Update Sidebar access in base.html
Browse files Browse the repository at this point in the history
- If user is staff (Office or admin): access programs dropdown with
    links disabled
- If user is superuser: access admin. Else no access to admin.
	modified:   templates/base.html
  • Loading branch information
mikerae committed Oct 8, 2023
1 parent c6aaa0d commit a4c4b78
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,8 @@ <h6>{{user.first_name}} {{user.last_name}}</h6>

<ul class="sidebar-nav" id="sidebar-nav">

{% if request.user.is_staff %}
{% else %}


<!-- Projects Nav -->
<li class="nav-item">
<a class="nav-link collapsed" data-bs-target="#components-nav" data-bs-toggle="collapse" href="#">
Expand All @@ -128,15 +128,21 @@ <h6>{{user.first_name}} {{user.last_name}}</h6>
<ul id="components-nav" class="nav-content collapse " data-bs-parent="#sidebar-nav">
<li>
{% for project in projects %}
{% if request.user.is_staff %}
<a href="">
<i class="bi bi-circle"></i><span>{{project.name}}</span>
</a>
{% else %}
<a href="{% url 'rota' project.slug %}">
<i class="bi bi-circle"></i><span>{{project.name}}</span>
</a>
{% endif %}
{% endfor %}
</li>
</ul>
</li>
<!-- End Projects Nav -->
{% endif %}

<!-- Register Nav -->
{% if rota_manager %}
<li class="nav-item">
Expand All @@ -145,7 +151,7 @@ <h6>{{user.first_name}} {{user.last_name}}</h6>
</a>
</li>
{% endif %}
{% if request.user.is_staff %}
{% if request.user.is_superuser %}
<li class="nav-item">
<a class="nav-link collapsed" href="../admin/">
<i class="bi bi-menu-button-wide"></i><span>Admin</span>
Expand Down

0 comments on commit a4c4b78

Please sign in to comment.