diff --git a/docs/source/conf.py b/docs/source/conf.py
index 7e99943..d45b1cd 100644
--- a/docs/source/conf.py
+++ b/docs/source/conf.py
@@ -132,6 +132,7 @@ extensions = {
'sphinx.ext.autodoc',
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
+ 'sphinx.ext.napoleon',
'sphinx_rtd_theme',
'sphinx.ext.graphviz',
'sphinx.ext.inheritance_diagram',
@@ -205,3 +206,5 @@ set_type_checking_flag = True
typehints_fully_qualified = True
always_document_param_types = True
typehints_document_rtype = True
+
+napoleon_attr_annotations = True
diff --git a/main/extra_func.py b/main/extra_func.py
index 75a9f72..3e54ae4 100644
--- a/main/extra_func.py
+++ b/main/extra_func.py
@@ -115,7 +115,7 @@ class ZendeskAdmin:
user = self.admin.users.search(email).values[0]
return user.organization.name if user.organization else None
- def create_admin(self) -> Zenpy:
+ def create_admin(self) -> None:
"""
Функция создает администратора, проверяя наличие вводимых данных в env.
@@ -142,7 +142,7 @@ class ZendeskAdmin:
raise ValueError('invalid access_controller`s login data')
-def update_role(user_profile: UserProfile, role: int) -> UserProfile:
+def update_role(user_profile: UserProfile, role: int) -> None:
"""
Функция меняет роль пользователя.
@@ -158,7 +158,7 @@ def update_role(user_profile: UserProfile, role: int) -> UserProfile:
zendesk.admin.users.update(user)
-def make_engineer(user_profile: UserProfile, who_changes: User) -> UserProfile:
+def make_engineer(user_profile: UserProfile, who_changes: User) -> None:
"""
Функция устанавливает пользователю роль инженера.
@@ -168,7 +168,7 @@ def make_engineer(user_profile: UserProfile, who_changes: User) -> UserProfile:
update_role(user_profile, ROLES['engineer'])
-def make_light_agent(user_profile: UserProfile, who_changes: User) -> UserProfile:
+def make_light_agent(user_profile: UserProfile, who_changes: User) -> None:
"""
Функция устанавливает пользователю роль легкого агента.
diff --git a/main/forms.py b/main/forms.py
index 613fc34..81b2e8a 100644
--- a/main/forms.py
+++ b/main/forms.py
@@ -14,7 +14,7 @@ class CustomRegistrationForm(RegistrationFormUniqueEmail):
:type visible_fields.email: :class:`django_registration.forms.RegistrationFormUniqueEmail`
"""
- def __init__(self, *args, **kwargs) -> RegistrationFormUniqueEmail:
+ def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
for visible in self.visible_fields():
if visible.field.widget.attrs.get('class', False):
@@ -96,12 +96,11 @@ class StatisticForm(forms.Form):
:type range_end: :class:`django.forms.fields.DateField`
"""
email = forms.EmailField(
- label='Электроная почта',
+ label='Электронная почта',
widget=forms.EmailInput(
attrs={
'placeholder': 'example@ngenix.ru',
'class': 'form-control',
- 'style': 'background-color:#f2f2f2;'
}
),
)
diff --git a/main/templates/base/menu.html b/main/templates/base/menu.html
index 93799a5..ef5df18 100644
--- a/main/templates/base/menu.html
+++ b/main/templates/base/menu.html
@@ -15,21 +15,27 @@
{% else %}
class="btn btn-secondary"
{% endif %}
- href="{% url 'profile' %}">Профиль
+ href="{% url 'profile' %}">Профиль
{% if perms.main.has_control_access %}
Управление
+ href="{% url 'control' %}">Управление
+ Статистика
{% else %}
Запрос прав
+ href="{% url 'work' request.user.id %}">Запрос прав
{% endif %}
Выйти
@@ -40,13 +46,13 @@
{% else %}
class="btn btn-secondary"
{% endif %}
- href="/accounts/login">Войти
+ href="/accounts/login">Войти
Зарегистрироваться
+ href="/accounts/register">Зарегистрироваться
{% endif %}
diff --git a/main/templates/pages/adm_ruleset.html b/main/templates/pages/adm_ruleset.html
index c0a5ad9..a951f80 100644
--- a/main/templates/pages/adm_ruleset.html
+++ b/main/templates/pages/adm_ruleset.html
@@ -8,6 +8,7 @@
{% block extra_css %}
+
{% endblock %}
{% block extra_scripts %}
@@ -21,7 +22,7 @@
-
Свободных Мест: {{ licences_remaining }}
+
Свободных Мест:
{% block form %}
@@ -37,10 +38,16 @@
+
+
+ |
Name |
Email |
Role |
- Checked |
diff --git a/main/templates/pages/statistic.html b/main/templates/pages/statistic.html
index 9a9219b..b467250 100644
--- a/main/templates/pages/statistic.html
+++ b/main/templates/pages/statistic.html
@@ -26,7 +26,7 @@
{% for radio in form.interval%}
{{ radio.tag }}
-