Merge pull request #1470 from eeintech/hide_system_alert_nostaff

Hide system alert for non-staff users
This commit is contained in:
Oliver 2021-04-17 08:04:45 +10:00 committed by GitHub
commit d3da262687
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 4 deletions

View File

@ -185,6 +185,10 @@
color: #c55;
}
.icon-orange {
color: #fcba03;
}
.icon-green {
color: #43bb43;
}

View File

@ -59,11 +59,17 @@
{% endif %}
<li class='dropdown'>
<a class='dropdown-toggle' data-toggle='dropdown' href="#">
{% if user.is_staff %}
{% if not system_healthy %}
<span class='fas fa-exclamation-triangle icon-red'></span>
{% if not django_q_running %}
<span class='fas fa-exclamation-triangle icon-red'></span>
{% else %}
<span class='fas fa-exclamation-triangle icon-orange'></span>
{% endif %}
{% elif not up_to_date %}
<span class='fas fa-info-circle icon-green'></span>
{% endif %}
{% endif %}
<span class="fas fa-user"></span> <b>{{ user.get_username }}</b></a>
<ul class='dropdown-menu'>
{% if user.is_authenticated %}
@ -77,10 +83,14 @@
<hr>
<li><a href="{% url 'settings' %}"><span class="fas fa-cog"></span> {% trans "Settings" %}</a></li>
<li id='launch-stats'><a href='#'>
{% if system_healthy %}
<span class='fas fa-server'>
{% if system_healthy or not user.is_staff %}
<span class='fas fa-server'></span>
{% else %}
<span class='fas fa-server icon-red'>
{% if not django_q_running %}
<span class='fas fa-server icon-red'></span>
{% else %}
<span class='fas fa-server icon-orange'></span>
{% endif %}
{% endif %}
</span> {% trans "System Information" %}
</a></li>