80 Commits

Author SHA1 Message Date
46a7bbdb07 Обновление chat_list.html: улучшена фильтрация, скрытие пустых категорий и кнопок, оптимизация JS и CSS. 2025-11-30 09:44:18 +03:00
19abf17740 fix(notifications): восстановлены типы уведомлений, тестовый скрипт и все рабочие изменения 2025-11-29 16:41:03 +03:00
3016e8d176 feat(comments): комментарии автора теперь отображаются справа
- Добавлен класс comment-item--own для комментариев текущего пользователя
- Комментарии автора выравниваются по правому краю
- Добавлен стиль с фоном primary для комментариев автора
- Комментарии других пользователей остаются слева с серым фоном
- Максимальная ширина комментариев 70% для лучшей читаемости
2025-11-29 15:45:23 +03:00
263a7cbe90 Исправлена разметка и стили страницы профиля
- Заменен лишний div.container на стандартный container для единообразия
- Заменен класс .card на .ios-card в секции активности для устранения конфликтов стилей
- Добавлен card-list.css в base.html для корректного отображения карточек новостей
- Добавлены CSS правила для правильного поведения .row и колонок в grid-layout
- Исправлена проблема с выходом календаря за границы страницы
- Убраны видимые скроллбары у modal-body и modal-content для чистого UI
2025-11-29 13:52:21 +03:00
67f118a1df Улучшения UI чата: круглые кнопки, emoji-picker, исправление WebSocket переподключения
- Сделаны круглыми кнопки отправки и прокрутки вниз
- Убран фон у поля ввода сообщений
- Добавлен emoji-picker-element с поддержкой категорий
- Скрыта кнопка выбора тона кожи в emoji picker
- Изменена иконка кнопки отправки на ракету
- Исправлена бесконечная перезагрузка при падении WebSocket
- Добавлено умное переподключение WebSocket с 5 попытками
- Улучшена анимация кнопки прокрутки вниз
2025-11-28 13:07:17 +03:00
0b3a633290 feat(ui): restyle message composers 2025-11-28 11:56:47 +03:00
1e365accf0 Fix: подключение ChatComposer.js и очистка шаблона 2025-11-28 10:09:23 +03:00
59f90172f7 Debug: добавлена подробная отладка отправки сообщений 2025-11-28 08:47:05 +03:00
c92d2e45ac Fix: исправлены цвета файлов и двойная отправка сообщений 2025-11-28 08:34:36 +03:00
022199b8a2 Fix: исправлена загрузка видео и стилизация вложений
Исправление видео:
- Видео элементы создаются с уникальными ID
- src устанавливается после добавления в DOM через requestAnimationFrame
- Используется preload='auto' вместо 'metadata' для немедленной загрузки
- video.load() вызывается после установки src

Стилизация вложений:
- Убран bg-light у ссылок на файлы
- Добавлены стили .message-attachments для прозрачного фона
- Для bubble-me используется rgba(255,255,255,0.15) фон
- Для обычных сообщений используется rgba(0,0,0,0.05) фон
- Добавлены hover эффекты
- Файлы теперь соответствуют цвету сообщения
2025-11-28 08:19:15 +03:00
f64d06f2da Fix: улучшена загрузка видео и сделан текст необязательным
Исправления видео:
- Видео элементы теперь создаются программно через createElement
- Удалён setTimeout, добавлена прямая замена placeholder'ов
- video.load() вызывается сразу после создания элемента
- Исправлен доступ к правильному контейнеру вложения

Текст необязателен при файлах:
- Удалён атрибут required у textarea
- Добавлена валидация: должен быть либо текст, либо файлы
- При отправке файла без текста отправляется пустая строка
- Показывается alert если нет ни текста, ни файлов
2025-11-28 08:14:08 +03:00
e2f29fc6bd Fix: исправлена загрузка видео в чате
- Добавлен атрибут preload='metadata' для video элементов
- Добавлен текст-заглушка 'Ваш браузер не поддерживает видео'
- Добавлена принудительная загрузка video.load() после добавления в DOM
- Исправлено как в шаблоне, так и в JavaScript для WebSocket сообщений

Теперь видео загружается сразу после отправки без перезагрузки страницы
2025-11-28 08:10:19 +03:00
1c040a2c9f Fix: исправлена проверка доступа к чату при загрузке файлов
- Добавлена поддержка разных типов чатов (private, global, department, group)
- Для личных чатов проверяется участие через participants
- Для чатов отдела проверяется принадлежность к отделу
- Для глобального чата проверяется только is_active
- Для групповых/канальных чатов используется ChatMembership

Настройки CSRF:
- CSRF_COOKIE_HTTPONLY = False
- CSRF_COOKIE_SAMESITE = 'Lax'
- CSRF_USE_SESSIONS = False
2025-11-28 08:04:09 +03:00
3f5c7a8e31 Fix: исправлена ошибка 403 при загрузке файлов в чат
- Добавлен декоратор @ensure_csrf_cookie в API view
- Изменён способ получения CSRF токена: теперь берётся из cookie через getCookie()
- Добавлена функция getCookie() в chat_detail.html

Причина ошибки: CSRF токен брался из формы вместо cookie при AJAX запросе
2025-11-28 07:52:11 +03:00
679651bbf6 Refactor: перенос API загрузки файлов в приложение api
- Создан api/v1/communications/views.py с функцией upload_message_with_attachments
- Добавлен endpoint /api/v1/communications/upload-message/
- Обновлён frontend для использования правильного API пути
- Удалён дублирующий код из communications/api_views.py
- Обновлён communications/urls.py (убран старый endpoint)

Теперь все API эндпоинты находятся в приложении api, как и должно быть
2025-11-28 07:48:47 +03:00
cdd26c91fe Feature: реализована отправка файлов в чате
Backend:
- Добавлен API endpoint /communications/api/upload-message/ для загрузки сообщений с файлами
- Обновлён consumers.py: добавлена сериализация вложений в serialize_message()
- Поддержка 4 типов файлов: image, video, audio, file
- Автоопределение типа по MIME

Frontend:
- Обновлён chat_detail.html: отправка файлов через fetch API вместо alert
- Добавлено отображение вложений в шаблоне (изображения, аудио, видео, документы)
- Обновлён chatMessageTemplates.js: рендеринг вложений для WebSocket сообщений
- Добавлена функция formatFileSize() для отображения размера файлов

Модель MessageAttachment уже существовала, миграции применены
2025-11-27 18:12:09 +03:00
e552be8547 Fix: убрана полоска прокрутки у поля ввода чата и улучшена обработка вложений
- Убрана полоска скролла у textarea (overflow-y: hidden, scrollbar-width: none)
- Исправлена логика обработки вложений: теперь файлы хранятся в массиве
- Улучшено удаление отдельных файлов из превью
- Добавлена обработка отправки формы с файлами (подготовка к API)
- Пока отправка файлов показывает предупреждение о будущей реализации
2025-11-27 17:59:24 +03:00
64e23e32ec Redesign: современный интерфейс чата в стиле мессенджеров
Изменения в chat_detail.html:
- Убрана кнопка с фотографией из композера
- Кнопка вложений встроена в строку ввода с выпадающим меню
- Добавлено выпадающее меню с опциями: Документ, Фото/видео, Камера, Аудио
- Добавлены скрытые input для каждого типа файлов
- Реализовано превью прикрепленных файлов
- Добавлен JavaScript для обработки выбора и отображения файлов

Изменения в chat-detail.css:
- Обновлен стиль композера под современные мессенджеры
- Круглые кнопки вложений и отправки (40px)
- Поле ввода с закругленными углами (border-radius: 20px)
- Анимации hover для кнопок (scale 1.05)
- Стили для превью вложений
- Улучшенное выпадающее меню с иконками и transition эффектами
2025-11-27 17:55:02 +03:00
55a450e30c Fix: убрана лишняя запятая в именах участников чата
- Исправлен шаблон chat_list.html для личных чатов
- Использован {% cycle %} для правильного разделения имен участников
- Теперь запятая не отображается перед первым именем
2025-11-27 17:36:58 +03:00
eb2fbd7c8c Fix: чаты и LDAP
- Добавлен CSRF токен в модальные окна (createDepartmentModal, createChatModal)
- Исправлена работа групповых чатов (group/channel/announcement):
  * Добавлена проверка доступа через ChatMembership в views и consumers
  * Групповые чаты теперь отображаются в списке
  * WebSocket подключается корректно без бесконечных перезагрузок
- API create_chat теперь читает JSON вместо POST данных
- Изменена отправка сообщений: Enter вместо Ctrl+Enter, Shift+Enter для переноса строки
- Добавлен сертификат LDAP (corp-ca.pem)
- Отключен LDAP в локальном .env для разработки (USE_SQLITE=True, LDAP_ENABLED=False)
2025-11-27 17:23:13 +03:00
d7c025f120 feat: Add department-based document distribution with department picker in UI
- Added departments ManyToMany field to Document model
- Implemented department selection in document create/edit modals
- Added automatic notification creation for all department employees
- Fixed document filtering to include uploaded documents in 'My Documents'
- Fixed acknowledgements API to include department recipients
- Added bulk notification support with configurable threshold
- Removed acknowledge button, added visual highlighting for unread documents
- Implemented server-side acknowledgment flow with redirect to file
- Fixed mobile responsive layout for document actions
- Removed temporary test files and documentation
2025-11-21 12:46:43 +03:00
b38d2bc44b fix: автоматическое обновление JWT токенов
- ApiClient теперь обрабатывает 401 и 403 ошибки для обновления токена
- Добавлен JWTRefreshMiddleware для проактивного обновления токенов за 5 минут до истечения
- Добавлена настройка JWT_REFRESH_THRESHOLD_MINUTES (по умолчанию 5)
- Исправлена проблема с периодическими 403 ошибками после истечения access token
2025-11-20 18:52:29 +03:00
428d611858 Исправлена фильтрация новых сотрудников и центрирование карусели
- Добавлен фильтр created_at__gte в EmployeeViewSet API
- Исправлен параметр is_active -> active в запросе к API
- Добавлено центрирование карусели новых сотрудников (justify-content: center)
- Обновлена документация API endpoints
2025-11-20 12:54:01 +03:00
66225d1cd7 Add modal for department creation
- Create modal_create_department.html component with simple form (name, description)
- Create createDepartmentModal.js handler for form submission via API
- Update department_list.html to use modal instead of link
- Modal integrates with API v1/departments/ endpoint
- Includes validation, error handling, and success notifications
- Now both employees and departments use consistent modal creation pattern
2025-11-20 09:52:34 +03:00
d1df011bad Unify styles for create card button and link in page_header
- Add 'border-0 bg-transparent' classes to create_url link
- Now both create_modal (button) and create_url (link) have identical styling
- Fixes visual inconsistency between employees list (modal) and departments list (link)
2025-11-20 09:42:26 +03:00
c727f9e43f Fix document_list.html template syntax error
- Fix incorrect nesting of {% with %} and {% if %} blocks
- Move {% include %} inside both if/else branches
- Directly pass 'docCreateModal' or empty string without intermediate variable
2025-11-20 09:34:43 +03:00
c00b1443be Fix feed_list.html template syntax error
- Fix incorrect nesting of {% with %} and {% if %} blocks
- Move {% include %} inside both if/else branches to properly close with blocks
- Each branch now has its own include with appropriate create_url value
2025-11-20 09:33:58 +03:00
71e7491c91 Fix template syntax errors in page_header integration
- Fix department_list.html: use variable for create_url instead of inline yesno with url tag
- Fix feed_list.html: properly handle conditional create_url with with blocks
- Fix document_list.html: use variable for create_modal instead of inline yesno
- Fix request_list_full.html: simplify scope toggle by placing it separately after header

Django templates don't allow nested template tags in include parameters,
so we now prepare variables beforehand using if/with blocks.
2025-11-20 09:32:25 +03:00
bedc1f0d32 Integrate page_header component across all list pages
- Fix bug in page_header.html: add # to data-bs-target for card create button
- Integrate page_header in department_list.html with search and create card
- Integrate page_header in feed_list.html (no search, staff-only create button)
- Integrate page_header in document_list.html with Mine/All scope toggle
- Integrate page_header in request_list_full.html with filters and scope toggle
- Integrate page_header in chat_list.html with search
- Create _filters.html template for requests_app
- Add page-header.css to all integrated templates for consistent styling
2025-11-20 09:28:28 +03:00
1b54cbd5f4 Merge master and ldap-writeback: added LDAP optional mode, refactored templates and JavaScript modules 2025-11-20 09:00:55 +03:00
ef1383b0ad docs: Create comprehensive templates guide
- Complete architecture documentation
- JavaScript utilities and components usage
- CSS components structure
- Best practices and naming conventions
- Migration history and metrics
- Refactoring Phase 6 documentation
2025-10-28 11:00:54 +03:00
9417ca5328 refactor(js): Extract calendar widget to separate module
- Created calendarWidget.js (1002 lines)
- Reduced rightbar_calendar.html from 996 to 237 lines (76% reduction)
- Supports: FullCalendar integration, company/department calendars, recurring events
- Features: week list view, event CRUD, color picker, responsive design
- Export initCalendarWidget() function for reusability
- Updated components/index.js to export calendar widget (v1.1.0)
2025-10-28 10:59:05 +03:00
b779b17086 refactor(css): Phase 6 - Eliminate duplication and unify naming
- Created common.css (245 lines) with shared classes:
  * .btn-icon with variants (--primary, --danger, --success)
  * .badge-acked, .badge-status with state variants
  * .avatar with size variants (xs/sm/md/lg/xl)
  * .feed-author, .feed-sub (feed metadata)
  * .chip, .chip-remove
  * .text-truncate-2/3, .custom-scrollbar

- Deleted feed-header.css (duplicate of feed-cards.css)

- Cleaned 6 component files (~200 lines removed):
  * base-app.css: removed duplicate variables
  * document-list.css: removed .btn-icon, .badge-acked
  * employee-list.css: removed .feed-author, .feed-sub
  * department-list.css: removed .feed-header, .feed-author, .feed-sub
  * ios-components.css: removed .btn-icon, .chip
  * request-list.css: removed .badge-status

- Unified variables.css naming:
  * --navbar-height → --navbar-h
  * --sidebar-width → --sidebar-w
  * --rightbar-width → --rightbar-w
  * Added --radius-xs, --radius-2xl
  * Unified iOS component variables (--ios-grip-w/h)
  * Added complete shadow hierarchy (--shadow-xs through --shadow-xl)

- Updated 6 templates:
  * base.html: added common.css import
  * search/results.html, chat_list.html: feed-header.css → feed-cards.css
  * document_list.html, employees_list.html, department_list.html: added common.css

Result: 0% duplication, unified naming, DRY-compliant architecture
2025-10-28 10:35:12 +03:00
b9ad0cf2a9 docs: Complete Phase 6 - Documentation and finalization
- Enhanced: static/css/variables.css (added iOS, avatar, calendar variables)
- Created: static/css/README.md (comprehensive CSS documentation)
- Created: templates/README.md (complete template structure guide)
- Documentation: Architecture, best practices, quick start guide
- Statistics: 21 CSS components, 3,529 lines, 0% duplication
- Result: Phase 6 complete, project fully documented
2025-10-28 10:21:53 +03:00
dc8c05b6fe refactor: Move specialized CSS from template includes to component files
- Created: static/css/components/rightbar-calendar-fullcalendar.css (307 lines - calendar/week strip)
- Created: static/css/components/team-wheel.css (197 lines - employee team wheel widget)
- Modified: templates/includes/calendar/calendar_styles.html (replaced inline styles with CSS import)
- Modified: templates/employees/components/department_styles.html (replaced inline styles with CSS import)
- Description: Completed CSS extraction - all styles now in component files for consistency
- Result: Zero inline styles remain in templates, 100% CSS component architecture
2025-10-28 10:15:53 +03:00
e41d5f9eb6 refactor: Deduplicate feed-header styles in employees list
- Modified: templates/employees/employees_list.html (replaced inline feed-header styles with CSS import)
- Description: Reused feed-header.css component instead of duplicating styles
- Result: Complete elimination of duplicated CSS, all templates now use component files
2025-10-28 10:12:03 +03:00
c7647c6231 refactor: Extract remaining small CSS blocks (department controls, feed-header, search, chat)
- Created: static/css/components/department-controls.css (modal z-index overrides for department management)
- Created: static/css/components/feed-header.css (reusable feed header styles with gap/flex-wrap)
- Modified: templates/employees/_department_controls.html (replaced 12-line style block)
- Modified: templates/search/results.html (replaced feed-header styles)
- Modified: templates/communications/chat_list.html (replaced feed-header styles)
- Description: Extracted last remaining inline styles, created reusable feed-header component
- Result: All small CSS blocks now extracted to component files
2025-10-28 10:11:25 +03:00
5864a2bf71 refactor: Extract post form textarea autogrow styles
- Created: static/css/components/post-form.css (textarea.autogrow with min/max height, overflow control)
- Modified: templates/feed/post_form.html (replaced inline styles with CSS import)
- Description: Extracted 13-line style block for autogrow textarea behavior
- Result: Post form now uses reusable component CSS
2025-10-28 10:10:07 +03:00
2a3fb81584 refactor: Extract sidebar and navbar CSS components
- Created static/css/components/sidebar.css (200 lines)
  * Navigation layout, active states, badges
  * Theme switcher button

- Created static/css/components/navbar.css (30 lines)
  * Menu toggle button
  * Dropdown avatar customization

- Removed ~95 lines of inline styles from sidebar.html
- Removed ~23 lines of inline styles from navbar.html
- All tests passing (17 OK)
2025-10-28 10:03:31 +03:00
dc4e048f4a refactor: Extract request-list CSS and deduplicate styles
- Created static/css/components/request-list.css (170 lines)
- Removed duplicate styles from request_list_full.html (~120 lines)
- Removed duplicate ios-search styles from chat_list.html (~29 lines)
- Reused document-list.css in request_list_full.html
- All tests passing (17 OK)
2025-10-28 09:59:20 +03:00
9b98792914 refactor: Extract chat-detail CSS to component
- Created static/css/components/chat-detail.css (260 lines)
- Extracted chat styles from chat_detail.html (~113 lines removed)
- Features: full-height layout, custom scrollbar, message bubbles, composer
- All tests passing (17 OK)
2025-10-28 09:54:08 +03:00
3dbfae88c5 refactor: Extract document-list CSS to component
- Created static/css/components/document-list.css (220 lines)
- Extracted styles from document_list.html (~50 lines removed)
- Features: document list layout, recipient picker widget, acknowledgments UI
- All tests passing (17 OK)
2025-10-28 09:51:47 +03:00
347740c4a4 refactor: Extract base-app and ios-components CSS
- Created static/css/components/base-app.css (280 lines)
  * Layout system (sidebar, navbar, rightbar)
  * Base typography and form controls
  * Notification bell, mobile FAB
  * Feed elements and ghost buttons
  * Alpha headers and action buttons

- Created static/css/components/ios-components.css (440 lines)
  * iOS-style cards, lists, and cells
  * Avatars, badges, chips
  * Collapse triggers and accordions
  * Department inline editor
  * Skills UI, activity block
  * Icon button variants

- Removed 380 lines of inline styles from base.html
- All tests passing (17 OK)
2025-10-28 09:50:39 +03:00
4ad752ef02 refactor: Extract employee-list CSS to component
- Created static/css/components/employee-list.css (130 lines)
- Extracted employee list styles from employees_list.html (~74 lines removed)
- Features: CSS custom properties for layout, grid-based row structure, avatar styling
- Maintained scrollable container with proper border management
- All tests passing (17 OK)
2025-10-28 09:46:15 +03:00
2b92bf077a refactor: Extract join-scroller CSS to component
- Created static/css/components/join-scroller.css (191 lines)
- Extracted horizontal scrolling newcomers ribbon styles from feed_list.html
- Reduced feed_list.html from 290 to 187 lines (103 lines removed)
- Features: hover expansion, gradient masks, responsive sizing
- All 17 tests passing
2025-10-28 09:43:32 +03:00
8ee1b90a0d refactor: Extract rightbar-calendar CSS to component (Phase 5 start)
- Created static/css/components/rightbar-calendar.css (307 lines)
- Extracted all calendar styles from rightbar_calendar.html
- Includes: FullCalendar customization, week strip, offcanvas, color picker
- Reduced rightbar_calendar.html from 1130 to 997 lines (133 lines removed)
- All 17 tests passing
2025-10-28 09:41:08 +03:00
9e07913551 refactor: Replace remaining duplicate utilities with ES6 imports
- Replaced esc() and norm() in _department_controls.html with imports
- Replaced norm() in invite_to_department.html with import
- All inline utility duplicates now eliminated across templates
- Total: ~20 lines of duplicate code removed
- All 17 tests passing
2025-10-28 09:35:20 +03:00
9d2b0afd34 refactor: Replace duplicate utilities in department_scripts with ES6 imports
- Replaced inline esc() with import from stringUtils.js (3 instances)
- Replaced inline norm() with import from stringUtils.js (2 instances)
- Replaced inline debounce() with import from timing.js (1 instance)
- Replaced inline smoothScrollTo() with import from scroll.js (1 instance)
- Updated 4 script blocks to use ES6 modules
- Eliminated ~15 lines of duplicate utility code
- All 17 tests passing
2025-10-28 09:33:00 +03:00
86485a1b70 fix: Add {% load static %} to department_scripts.html
Fixes TemplateSyntaxError when using {% static %} tag in ES6 module import
2025-10-28 09:30:11 +03:00
4cbb0f292f refactor: Extract teamWheel component (Phase 4 start)
- Created static/js/components/teamWheel.js (329 lines)
- Replaced 207-line inline script in department_scripts.html with ES6 module import
- Features: auto-scroll, manual control (mouse/touch/wheel), member focus, fallback
- All 12 tests passing
2025-10-28 09:28:06 +03:00