- {# Вкладка "Мои" — как раньше #}
+ {# Вкладка "Мои" — просто бейдж для ознакомленных #}
{% if scope == 'mine' %}
{% if doc.id in acked_ids %}
-
Ознакомлен
- {% else %}
-
Ознакомиться
+
✓ Ознакомлен
{% endif %}
{# Вкладка "Все" — кнопка модалки #}
@@ -104,11 +117,28 @@
{% endif %}
- {# ===== Пагинация (если понадобится — через next_url/prev_url) ===== #}
- {% if prev_url or next_url %}
-
-
Назад
-
Вперёд
+ {# ===== Пагинация ===== #}
+ {% if prev_url or next_url or page > 1 %}
+
+ {% if prev_url %}
+
+ Назад
+
+ {% else %}
+
+ Назад
+
+ {% endif %}
+
+ {% if next_url %}
+
+ Вперёд
+
+ {% else %}
+
+ Вперёд
+
+ {% endif %}
{% endif %}
@@ -143,9 +173,18 @@
+
+
+
+
+ Удерживайте Ctrl/Cmd для выбора нескольких
+
+
-
+
@@ -192,9 +231,18 @@
+
+
+
+
+ Удерживайте Ctrl/Cmd для выбора нескольких
+
+
-
+
@@ -270,6 +318,7 @@
const apiListUrl = "{{ api_document_list_url|default:'' }}";
const apiDetailBase = "{{ api_document_detail_base|default:'' }}";
const employeesApi = "{% url 'api:v1:employees-list' %}";
+ const departmentsApi = "{% url 'api:v1:departments-list' %}";
// Инициализация RecipientPicker для формы создания
const createPicker = new RecipientPicker(
@@ -289,7 +338,8 @@
apiDetailBase: apiDetailBase,
headers: headersAuth,
createPicker: createPicker,
- editPicker: editPicker
+ editPicker: editPicker,
+ departmentsApi: departmentsApi
});
// Инициализация модалки ознакомлений
diff --git a/backend/templates/employees/employee_detail.html b/backend/templates/employees/employee_detail.html
index e302b2c3..484d2231 100644
--- a/backend/templates/employees/employee_detail.html
+++ b/backend/templates/employees/employee_detail.html
@@ -100,9 +100,9 @@
{{ emp.phone_number }}
{% endif %}
- {% if emp.telegram %}
Telegram: {{ emp.telegram }}
{% endif %}
- {% if emp.whatsapp %}
WhatsApp: {{ emp.whatsapp }}
{% endif %}
- {% if emp.wechat %}
WeChat: {{ emp.wechat }}
{% endif %}
+ {% if emp.telegram %}
{{ emp.telegram }}
{% endif %}
+ {% if emp.whatsapp %}
{{ emp.whatsapp }}
{% endif %}
+ {% if emp.wechat %}
{{ emp.wechat }}
{% endif %}
{% if not emp.email and not emp.phone_number and not emp.telegram and not emp.whatsapp and not emp.wechat %}
Контакты не указаны
{% endif %}
diff --git a/backend/templates/feed/department_feed.html b/backend/templates/feed/department_feed.html
index 955be10f..91e2cf87 100644
--- a/backend/templates/feed/department_feed.html
+++ b/backend/templates/feed/department_feed.html
@@ -46,7 +46,7 @@
{% if post.pinned %}
-
закреплено
+
{% endif %}
diff --git a/backend/templates/notifications/email/digest.html b/backend/templates/notifications/email/digest.html
new file mode 100644
index 00000000..d1400326
--- /dev/null
+++ b/backend/templates/notifications/email/digest.html
@@ -0,0 +1,183 @@
+
+
+
+
+
+
{{ digest_name }} дайджест
+
+
+
+
+
+
+
+
+
+
+
У вас {{ total_count }} {% if total_count == 1 %}новое уведомление{% elif total_count < 5 %}новых уведомления{% else %}новых уведомлений{% endif %}
+
+
+ {% for category_code, notifs in grouped_notifications.items %}
+
+
+
+ {% for notification in notifs %}
+
+
+ {{ notification.title }}
+
+
+ {{ notification.message|truncatewords:20 }}
+
+
+ {{ notification.created_at|date:"d.m.Y H:i" }}
+
+ {% if notification.action_url %}
+
+ {% endif %}
+
+ {% endfor %}
+
+ {% endfor %}
+
+
+ Посмотреть все уведомления
+
+
+
+
+
+
+
+
diff --git a/backend/templates/notifications/email/digest.txt b/backend/templates/notifications/email/digest.txt
new file mode 100644
index 00000000..db97b886
--- /dev/null
+++ b/backend/templates/notifications/email/digest.txt
@@ -0,0 +1,23 @@
+{{ site_name }} - {{ digest_name }} дайджест
+{{ '=' * 60 }}
+
+У вас {{ total_count }} {% if total_count == 1 %}новое уведомление{% elif total_count < 5 %}новых уведомления{% else %}новых уведомлений{% endif %}
+
+{% for category_code, notifs in grouped_notifications.items %}
+{{ category_icons|get_item:category_code }} {{ notifs.0.notification_type.category.name }} ({{ notifs|length }})
+{{ '-' * 60 }}
+
+{% for notification in notifs %}
+• {{ notification.title }}
+ {{ notification.message|truncatewords:30 }}
+ {{ notification.created_at|date:"d.m.Y H:i" }}
+ {% if notification.action_url %}→ {{ site_url }}{{ notification.action_url }}{% endif %}
+
+{% endfor %}
+{% endfor %}
+
+---
+Посмотреть все уведомления: {{ site_url }}/notifications/
+
+Управление уведомлениями: {{ site_url }}/notifications/settings/
+{{ site_url }}
diff --git a/backend/templates/notifications/email/notification.html b/backend/templates/notifications/email/notification.html
new file mode 100644
index 00000000..c02d5bed
--- /dev/null
+++ b/backend/templates/notifications/email/notification.html
@@ -0,0 +1,146 @@
+
+
+
+
+
+
{{ notification.title }}
+
+
+
+
+
+
+
+
+
+
{{ category_icon }}
+
+
+ {{ notification.title }}
+
+
+
+ {{ notification.message|linebreaks }}
+
+
+ {% if notification.metadata %}
+
+ {% for key, value in notification.metadata.items %}
+ {{ key }}: {{ value }}
+ {% endfor %}
+
+ {% endif %}
+
+ {% if action_url %}
+
+ {{ action_text }}
+
+ {% endif %}
+
+
+
+
+
+
+
diff --git a/backend/templates/notifications/email/notification.txt b/backend/templates/notifications/email/notification.txt
new file mode 100644
index 00000000..a840ae0e
--- /dev/null
+++ b/backend/templates/notifications/email/notification.txt
@@ -0,0 +1,23 @@
+{{ site_name }} - {{ category_name }}
+
+{{ notification.title }}
+{{ '=' * 60 }}
+
+{{ notification.message }}
+
+{% if notification.metadata %}
+---
+{% for key, value in notification.metadata.items %}
+{{ key }}: {{ value }}
+{% endfor %}
+{% endif %}
+
+{% if action_url %}
+{{ action_text }}: {{ action_url }}
+{% endif %}
+
+---
+Это автоматическое уведомление от системы {{ site_name }}.
+Управление уведомлениями: {{ site_url }}/notifications/settings/
+
+{{ site_url }}
diff --git a/backend/templates/notifications/notification_list.html b/backend/templates/notifications/notification_list.html
index 9e0eab88..e14ddc02 100644
--- a/backend/templates/notifications/notification_list.html
+++ b/backend/templates/notifications/notification_list.html
@@ -3,74 +3,81 @@
{% block title %}Уведомления{% endblock %}
+{% block extra_css %}
+
+{% endblock %}
+
{% block content %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Уведомлений пока нет
+
+
-
-
-
-
Загрузка...
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
+{% csrf_token %}
+{% endblock %}
+
+{% block extra_js %}
+
{% endblock %}
diff --git a/backend/templates/notifications/notification_list_new.html b/backend/templates/notifications/notification_list_new.html
deleted file mode 100644
index e14ddc02..00000000
--- a/backend/templates/notifications/notification_list_new.html
+++ /dev/null
@@ -1,83 +0,0 @@
-{% extends "base.html" %}
-{% load static %}
-
-{% block title %}Уведомления{% endblock %}
-
-{% block extra_css %}
-
-{% endblock %}
-
-{% block content %}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-{% csrf_token %}
-{% endblock %}
-
-{% block extra_js %}
-
-{% endblock %}
diff --git a/backend/templates/notifications/notification_settings.html b/backend/templates/notifications/notification_settings.html
index 117e7e63..a8234236 100644
--- a/backend/templates/notifications/notification_settings.html
+++ b/backend/templates/notifications/notification_settings.html
@@ -3,92 +3,143 @@
{% block title %}Настройки уведомлений{% endblock %}
+{% block extra_css %}
+
+
+{% endblock %}
+
{% block content %}
-
-
+
+{% csrf_token %}
+{% endblock %}
+
+{% block extra_js %}
+
+
{% endblock %}
diff --git a/backend/templates/notifications/notification_settings_new.html b/backend/templates/notifications/notification_settings_new.html
index 8c628f4c..e7cf5463 100644
--- a/backend/templates/notifications/notification_settings_new.html
+++ b/backend/templates/notifications/notification_settings_new.html
@@ -86,7 +86,15 @@
Отображаются в интерфейсе системы, в колокольчике и списке уведомлений
Email
-
Отправка уведомлений на вашу почту (будет доступно в следующих версиях)
+
+ Отправка уведомлений на вашу почту. Для включения отметьте чекбокс, затем выберите режим:
+
+ - Мгновенно - каждое уведомление отправляется сразу
+ - Ежедневный дайджест - все уведомления за день в одном письме
+ - Еженедельный дайджест - все уведомления за неделю в одном письме
+
+ Чтобы отключить email, снимите галочку с "Email уведомления"
+
Telegram
Отправка в Telegram бот (будет доступно в следующих версиях)
diff --git a/test_notifications.py b/test_notifications.py
deleted file mode 100644
index f92ba755..00000000
--- a/test_notifications.py
+++ /dev/null
@@ -1,72 +0,0 @@
-"""
-Тестовый скрипт для проверки системы уведомлений
-Запуск: python backend/test_notifications.py
-"""
-
-import os
-import sys
-import django
-
-# Настройка Django окружения
-sys.path.insert(0, os.path.join(os.path.dirname(__file__), 'backend'))
-os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'eusrr_backend.settings')
-django.setup()
-
-from django.contrib.auth import get_user_model
-from notifications.services import NotificationService
-from notifications.models import NotificationCategory, NotificationType, Notification
-
-User = get_user_model()
-
-print("=" * 80)
-print("ТЕСТ СИСТЕМЫ УВЕДОМЛЕНИЙ")
-print("=" * 80)
-
-# Проверка категорий
-print("\n1. Проверка категорий:")
-categories = NotificationCategory.objects.all()
-print(f" Создано категорий: {categories.count()}")
-for cat in categories:
- print(f" - {cat.name} ({cat.code}): {cat.types.count()} типов")
-
-# Проверка типов
-print("\n2. Проверка типов:")
-types = NotificationType.objects.all()
-print(f" Создано типов: {types.count()}")
-
-# Получить первого пользователя
-print("\n3. Тестовое уведомление:")
-try:
- user = User.objects.first()
- if user:
- print(f" Пользователь: {user.get_full_name() or user.username}")
-
- # Создать тестовое уведомление
- notification = NotificationService.create_notification(
- recipient=user,
- notification_type_code='system_new_feature',
- title='Система уведомлений запущена!',
- message='Базовая инфраструктура системы уведомлений успешно создана и готова к работе. Этап 1 завершен!',
- action_url='/notifications/',
- send_immediately=True
- )
-
- if notification:
- print(f" ✅ Уведомление создано: ID={notification.id}")
- print(f" Заголовок: {notification.title}")
- print(f" Отправлено на веб: {notification.sent_web}")
- else:
- print(" ⚠️ Уведомление не создано (возможно, тип отключен)")
- else:
- print(" ⚠️ Пользователи не найдены")
-except Exception as e:
- print(f" ❌ Ошибка: {e}")
-
-# Статистика
-print("\n4. Статистика:")
-total_notifications = Notification.objects.count()
-print(f" Всего уведомлений: {total_notifications}")
-
-print("\n" + "=" * 80)
-print("ТЕСТ ЗАВЕРШЕН")
-print("=" * 80)