Add DOCS_URL to settings, update README and env.example

This commit is contained in:
2021-05-29 22:59:20 -07:00
parent 2494be9be6
commit 74661bd7a4
6 changed files with 41 additions and 32 deletions

View File

@@ -1,3 +1,4 @@
{% load settings_value %}
{% load static %}
<header>
<meta charset="utf-8">
@@ -8,8 +9,8 @@
<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 class="px-2" style="color:#FFFFFF">Access Controller</t>
</a>
<div class="btn-group" role="group" aria-label="Basic example" style="margin-right: 9px">
{% if request.user.is_authenticated %}
<div class="btn-group" role="group" aria-label="Basic example" style="margin-right: 9px">
{% url 'profile' as profile_url %}
<a {% if request.path == profile_url %}
class="btn btn-primary"
@@ -42,11 +43,7 @@
href="{{ work_url }}">Запрос прав</a>
{% endif %}
<a class="btn btn-secondary" href="{% url 'logout' %}">Выйти</a>
<a class="btn btn-secondary"
href="https://actrl.cazzzer.com/docs/index.html"> Документация</a>
</div>
{% else %}
<div class="btn-group" role="group" aria-label="Basic example" style="margin-right: 9px">
{% url 'login' as login_url %}
<a {% if request.path == login_url %}
class="btn btn-primary"
@@ -61,10 +58,10 @@
class="btn btn-secondary"
{% endif %}
href="{{ registration_url }}">Зарегистрироваться</a>
{% url 'documentation' as documentation_url %}
<a class="btn btn-secondary"
href="{{ documentation_url }}">Документация</a>
</div>
{% endif %}
<a class="btn btn-secondary"
href="{% settings_value 'ACTRL_DOCS_URL' %}"> Документация
</a>
</div>
</nav>
</header>

View File

View File

@@ -0,0 +1,9 @@
from django import template
from django.conf import settings
register = template.Library()
@register.simple_tag
def settings_value(name):
return getattr(settings, name, "")