- Removed `light_color_code` from the Hadis and Transmitter serializers to streamline the API response.
- Updated the `ColorPaletteMixin` to simplify color management by eliminating the light color property, focusing on the main color code.
- Adjusted the serializers to reflect these changes, enhancing clarity and reducing redundancy in color representation.
- Introduced `SimilarArticleSerializer` to provide a structured representation of similar articles, including categories and thumbnail.
- Updated `ArticleDetailSerializer` to include a new `similar_articles` field, which fetches articles from the same categories, excluding the current article.
- Implemented a method to retrieve similar articles, improving the article detail view with relevant content suggestions.
- Introduced `ColorPaletteMixin` to centralize color choice fields and hex code properties across `HadisStatus`, `TransmitterReliability`, and `OpinionStatus` models.
- Updated the `color` field in these models to use the mixin, enhancing code reusability and maintainability.
- Modified serializers to include `main_color_code` and `light_color_code` properties for better color representation in API responses.
- Added a new migration to adjust the database schema for the updated models.
- Introduced the `EmbeddingSession` model to track the status and progress of embedding tasks, including fields for status, progress, processed items, and error messages.
- Created `EmbeddingSessionAdmin` to manage embedding sessions in the admin interface, featuring custom display methods for status badges and progress bars.
- Implemented background processing to trigger a FastAPI agent upon creating a new embedding session, enhancing the system's responsiveness and user experience.
- Added migrations to establish the new model in the database.
- Introduced a `share_link` property in the `Article`, `Hadis`, `Book`, `Podcast`, `Video`, and `Transmitter` models to generate shareable links based on their slugs.
- Updated corresponding serializers to include the `share_link` field as read-only.
- Added a management command to refresh share links for existing Hadis models, ensuring all instances have updated slugs and share links.
- Adjusted the `settings` to define `DOVODI_DOMAIN` for consistent link generation across models.
- Changed `TabularInline` to `StackedInline` for better layout of `AgentPrompt` entries.
- Adjusted the `AdminTextareaWidget` to enhance user experience with improved styling and sizing.
- Ensured the inline management of prompts remains user-friendly and visually appealing in the admin interface.
- Updated `AgentSettings` model to serve as a singleton container, removing unnecessary fields and adding an `updated_at` timestamp.
- Introduced `AgentPrompt` model to manage instruction prompts associated with agent settings.
- Enhanced `AgentSettingsAdmin` to include inline management of prompts, improving the admin interface for better usability.
- Created migrations to reflect the updated model structure and ensure database integrity.
- Introduced `seed_occasions.py` management command to populate the database with a comprehensive list of Persian, International, and Religious calendar occasions.
- Created `__init__.py` files in the management and commands directories to ensure proper package structure.
- Enhanced the seeding process with transaction management for data integrity during the creation of occasions.
- Introduced `OccasionsList` view to retrieve calendar occasions with filtering options for month and last updated timestamp.
- Updated URL patterns to include a new endpoint for syncing occasions and modified the existing occasions endpoint.
- Enhanced the `get_queryset` method to support filtering by month and last updated date, improving data retrieval flexibility.
- Created `Agent` app including models, admin configuration, and migrations for managing agent settings.
- Introduced `AgentSettings` model to store configuration parameters such as system prompt and model settings.
- Implemented `AgentSettingsAdmin` to provide a singleton admin interface for managing agent configurations.
- Registered the app in the project settings for integration.
- Updated `get_children_count` method to calculate the total number of Hadiths in a category and its descendants instead of counting active children categories.
- Enhanced code clarity by removing commented-out code and providing detailed docstrings for the new logic.
- Introduced `add_english_context_category.py` to populate missing English titles and descriptions for HadisCategory.
- Added `english_context.py` to fill in missing English context for Hadith fields including title, narrator, translation, and description.
- Created `arabic_text.py` to replace Hadith text with authentic Arabic texts.
- Updated `CategorySerializer` to calculate the total number of Hadiths in a category and its descendants.
- Removed dependency on `get_admin_namespace` and replaced it with direct language-based URL redirection for admin login in both `AdminAccessMiddleware` and `enhanced_auth_middleware`.
- Improved code clarity by utilizing Django's `get_language` to dynamically construct the redirect URL based on the user's language preference.
- Enhanced user experience by ensuring consistent access to the admin login page across different languages.
- Eliminated the inline `get_admin_namespace` function to streamline the code and improve readability.
- The function is now imported from the centralized `config.middleware` module, enhancing code organization and reusability.
- Moved the `get_admin_namespace` function from `admin_access.py` to a new `config.middleware` module for better organization and reusability.
- Updated `AdminAccessMiddleware` to utilize the centralized `get_admin_namespace` function, enhancing code maintainability.
- Improved documentation for the `get_admin_namespace` function to clarify its usage and purpose.
- Introduced a new function `get_admin_namespace` to determine the appropriate admin namespace based on the request domain (Dovoodi or Imam Javad).
- Updated `AdminAccessMiddleware` and `enhanced_auth_middleware` to utilize the new function for redirecting users to the correct admin login page, enhancing access control based on the domain.
- Improved code readability and maintainability by centralizing the logic for admin namespace resolution.
- Introduced a new URL pattern to redirect "/admin/" to the appropriate language-prefixed admin URL.
- Updated admin links for both Dovoodi and Imam Javad to remove language-specific paths, simplifying access.
- Refactored HomeView to streamline the redirection logic based on the current language.
<message>
- Introduced `urls_dovoodi.py` and `urls_imamjavad.py` for handling URL patterns specific to each domain.
- Implemented `SiteMiddleware` to route requests based on the request domain, ensuring clean admin URLs.
- Updated `base.py` settings to include the new middleware for domain-based routing.
- Modified Nginx configurations for both domains to support the new routing logic and SSL settings.
- Enhanced session handling by checking for active sessions before creating a new room in PlugNMeet, reducing unnecessary API calls.
- Implemented logic to reactivate ended sessions and log relevant actions for better traceability.
- Added conditional room creation to avoid duplicate rooms, improving overall efficiency and user experience.
- Updated CourseLiveSessionRoomCreateAPIView to filter out ended sessions by adding `ended_at__isnull=True` in the session creation logic.
- Introduced a new method in CourseLiveSessionTokenAPIView to build centralized metadata for room settings, ensuring client overrides are not permitted and enhancing session configuration consistency.
- Updated CourseLiveSessionRoomCreateAPIView to filter out ended sessions by adding `ended_at__isnull=True` in the session creation logic.
- Introduced a new method in CourseLiveSessionTokenAPIView to build centralized metadata for room settings, ensuring client overrides are not permitted and defining default lock settings and room features.
- Improved room verification logic in CourseLiveSessionTokenAPIView to handle both boolean and string responses for room activity status.
- Added functionality to automatically recreate inactive rooms for professors while denying token issuance for students if the room is inactive.
- Enhanced logging for better traceability of room status and actions taken during token requests.
- Introduced a new method to handle room recreation in PlugNMeet, ensuring sessions can be reactivated when necessary.