Refactored menu.html so there's no copypaste
This commit is contained in:
parent
ef646a7b09
commit
2e6db096d6
@ -5,33 +5,36 @@
|
||||
|
||||
<nav class="navbar navbar-light" style="background-color: #113A60;">
|
||||
<a class="navbar-brand" href="{% url 'index' %}">
|
||||
<img src="{% static 'main/img/logo_real.png' %}" width="107" height="22" class="d-inline-block align-top" alt="" loading="lazy">
|
||||
<img src="{% static 'main/img/logo_real.png' %}" width="107" height="22" class="d-inline-block align-top" style="margin-left: 15px" alt="" loading="lazy">
|
||||
<t style="color:#FFFFFF">Access Controller</t>
|
||||
</a>
|
||||
{% if request.user.is_authenticated %}
|
||||
<div class="btn-group" role="group" aria-label="Basic example">
|
||||
{% if profile_lit %}
|
||||
<a class="btn btn-primary" href="{% url 'profile' %}">Профиль</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href="{% url 'profile' %}">Профиль</a>
|
||||
{% endif %}
|
||||
<div class="btn-group" role="group" aria-label="Basic example" style="margin-right: 9px">
|
||||
<a {% if profile_lit %}
|
||||
class="btn btn-primary"
|
||||
{% else %}
|
||||
class="btn btn-secondary"
|
||||
{% endif %}
|
||||
href="{% url 'profile' %}">Профиль</a>
|
||||
{% if perms.main.has_control_access %}
|
||||
{% if control_lit %}
|
||||
<a class="btn btn-primary" href="{% url 'control' %}">Управление</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href="{% url 'control' %}">Управление</a>
|
||||
{% endif %}
|
||||
<a {% if control_lit %}
|
||||
class="btn btn-primary"
|
||||
{% else %}
|
||||
class="btn btn-secondary"
|
||||
{% endif %}
|
||||
href="{% url 'control' %}">Управление</a>
|
||||
{% else %}
|
||||
{% if work_lit %}
|
||||
<a class="btn btn-primary" href="{% url 'work' request.user.id %}">Запрос прав</a>
|
||||
{% else %}
|
||||
<a class="btn btn-secondary" href="{% url 'work' request.user.id %}">Запрос прав</a>
|
||||
{% endif %}
|
||||
<a {% if work_lit %}
|
||||
class="btn btn-primary"
|
||||
{% else %}
|
||||
class="btn btn-secondary"
|
||||
{% endif %}
|
||||
href="{% url 'work' request.user.id %}">Запрос прав</a>
|
||||
{% endif %}
|
||||
<a class="btn btn-secondary" href="{% url 'logout' %}">Выйти</a>
|
||||
</div>
|
||||
{% else %}
|
||||
<div class="btn-group" role="group" aria-label="Basic example">
|
||||
<div class="btn-group" role="group" aria-label="Basic example" style="margin-right: 9px">
|
||||
<a class="btn btn-secondary" href="/accounts/login">Войти</a>
|
||||
<a class="btn btn-secondary" href="/accounts/register">Зарегистрироваться</a>
|
||||
</div>
|
||||
|
@ -346,10 +346,11 @@ def statistic_page(request: WSGIRequest) -> HttpResponse:
|
||||
"""
|
||||
if not request.user.is_superuser:
|
||||
return redirect('index')
|
||||
context = {
|
||||
context = setup_context()
|
||||
context.update({
|
||||
'pagename': 'страница статистики',
|
||||
'errors': list(),
|
||||
}
|
||||
})
|
||||
if request.method == "POST":
|
||||
form = StatisticForm(request.POST)
|
||||
if form.is_valid():
|
||||
|
Loading…
x
Reference in New Issue
Block a user