diff --git a/backend/templates/documents/document_list.html b/backend/templates/documents/document_list.html index 87326ffc..cd1fdb4f 100644 --- a/backend/templates/documents/document_list.html +++ b/backend/templates/documents/document_list.html @@ -15,7 +15,13 @@
{# ===== НОВАЯ ШАПКА С КОМПОНЕНТОМ ===== #} - {% include "includes/components/page_header.html" with icon="bi-file-earmark-text" title="Документы" no_search=True scope_urls=scope_urls scope=scope create_modal=perms.documents.add_document|yesno:"#docCreateModal," create_text="Создать документ" create_icon="bi-plus-lg" %} + {% if perms.documents.add_document %} + {% with create_modal_id='docCreateModal' %} + {% else %} + {% with create_modal_id='' %} + {% endif %} + {% include "includes/components/page_header.html" with icon="bi-file-earmark-text" title="Документы" no_search=True scope_urls=scope_urls scope=scope create_modal=create_modal_id create_text="Создать документ" create_icon="bi-plus-lg" %} + {% endwith %} {# ===== Карточка со списком ===== #}
diff --git a/backend/templates/employees/department_list.html b/backend/templates/employees/department_list.html index 51bfc422..cc7ed638 100644 --- a/backend/templates/employees/department_list.html +++ b/backend/templates/employees/department_list.html @@ -17,7 +17,12 @@
{# ===== НОВАЯ ШАПКА С КОМПОНЕНТОМ ===== #} - {% include "includes/components/page_header.html" with icon="bi-diagram-3" title="Отделы" count=departments|length count_label="Всего:" search_id="deptFilter" search_placeholder="Поиск по названию или руководителю" create_as_card=True create_url=can_create_departments|yesno:"{% url 'employees:department_create' %}," create_text="Создать отдел" %} + {% if can_create_departments or perms.employees.add_department or request.user.is_staff or request.user.is_superuser %} + {% url 'employees:department_create' as dept_create_url %} + {% else %} + {% with dept_create_url='' %}{% endwith %} + {% endif %} + {% include "includes/components/page_header.html" with icon="bi-diagram-3" title="Отделы" count=departments|length count_label="Всего:" search_id="deptFilter" search_placeholder="Поиск по названию или руководителю" create_as_card=True create_url=dept_create_url create_text="Создать отдел" %}
diff --git a/backend/templates/feed/feed_list.html b/backend/templates/feed/feed_list.html index ca515abf..8c0ed365 100644 --- a/backend/templates/feed/feed_list.html +++ b/backend/templates/feed/feed_list.html @@ -15,7 +15,14 @@
{# ===== НОВАЯ ШАПКА С КОМПОНЕНТОМ ===== #} - {% include "includes/components/page_header.html" with icon="bi-megaphone" title="Лента" no_search=True create_url=user.is_authenticated|yesno:"{% if user.is_staff %}{% url 'feed:post_create' %}?type=company{% endif %}," create_text="Новая публикация" create_icon="bi-plus-circle" %} + {% if user.is_authenticated and user.is_staff %} + {% url 'feed:post_create' as post_create_url %} + {% with post_create_url=post_create_url|add:"?type=company" %} + {% else %} + {% with post_create_url='' %} + {% endif %} + {% include "includes/components/page_header.html" with icon="bi-megaphone" title="Лента" no_search=True create_url=post_create_url create_text="Новая публикация" create_icon="bi-plus-circle" %} + {% endwith %} {% if new_employees %}
diff --git a/backend/templates/requests_app/request_list_full.html b/backend/templates/requests_app/request_list_full.html index f56a5c83..ab3b562d 100644 --- a/backend/templates/requests_app/request_list_full.html +++ b/backend/templates/requests_app/request_list_full.html @@ -14,7 +14,25 @@
{# ===== НОВАЯ ШАПКА С КОМПОНЕНТОМ ===== #} - {% include "includes/components/page_header.html" with icon="bi-clipboard-check" title="Заявления" no_search=True scope_urls=can_process|yesno:"{ 'mine': '?view=mine'|add:filters.type|yesno:'&type='|add:filters.type|add:filters.status|yesno:'&status='|add:filters.status, 'all': '?view=all'|add:filters.type|yesno:'&type='|add:filters.type|add:filters.status|yesno:'&status='|add:filters.status }," scope=scope has_filters=True filters_target="reqFilters" filters_template="requests_app/_filters.html" create_modal="#reqCreateModal" create_text="Новое заявление" create_icon="bi-plus-lg" %} + {% if can_process or user.is_staff or user.is_superuser %} + {% include "includes/components/page_header.html" with icon="bi-clipboard-check" title="Заявления" no_search=True scope=scope has_filters=True filters_target="reqFilters" filters_template="requests_app/_filters.html" create_modal="reqCreateModal" create_text="Новое заявление" create_icon="bi-plus-lg" %} + + {# Переключатель scope отдельно (вставляется через extra_buttons не работает) #} + + {% else %} + {% include "includes/components/page_header.html" with icon="bi-clipboard-check" title="Заявления" no_search=True has_filters=True filters_target="reqFilters" filters_template="requests_app/_filters.html" create_modal="reqCreateModal" create_text="Новое заявление" create_icon="bi-plus-lg" %} + {% endif %} {# ===== Список ===== #}