upgrade dashboard to a better version having different data cards and charts and lists , to observe better information
update the background color of admin panel synced with imam-jawad theme
update unfold translations with new dashboard values
- 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.
- 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.
- Added checks in get_saved_location method to ensure user is authenticated and has location_history attribute before attempting to access it.
- Improved robustness of location retrieval logic to prevent errors for unauthenticated users.
- Introduced a new geolocation package containing APIs for IP-based geolocation, reverse geocoding, and region information.
- Added URL routes for geolocation endpoints in the account app.
- Implemented models, serializers, and views for handling geolocation data.
- Included GeoLite2 databases for IP to city and country lookups.
- Enhanced location history updates with optimized batch processing for improved performance.
- Updated settings to include the new geolocation package in installed apps.
- Added `city_detection_ip.py` for optimized location detection by coordinates and IP.
- Introduced caching for location results to improve performance.
- Updated `LocationHistoryView` to utilize new geolocation methods.
- Added `RegionInfoView` for retrieving region information based on IP and user agent.
- Included new dependencies `geoip2` and `geopy` in `requirements.txt`.
- Created GeoLite2 database files for city and country data.
- Updated URL patterns to include a new endpoint for region information.
- Introduced a new SerializerMethodField `saved_location` to retrieve the user's last known location from their location history.
- Updated the fields and read_only_fields in UserProfileSerializer to include `saved_location` for enhanced user profile data.
- Adjusted permission classes in CalendarList and AdjustmentConfigView to AllowAny for broader access.
Introduce ExchangeTokenAPIView at /api/account/exchange-token/ to
exchange temporary tokens for a DRF auth token and minimal user
profile (id, fullname, email, avatar). Tokens are one-time use and
validated via OnlineClassTokenManager. Added serializer, view, URL,
and Swagger examples.
Update CourseOnlineClassTokenAPIView to return a fixed join URL:
https://imamjavad.newhorizonco.uk/join-class?token={TOKEN}&slug={SLUG}.
Store course_slug in token payload and remove redirect_path and the
_base_components helper. Examples and docs updated.
Docs: add CHANGELOG_EXCHANGE_TOKEN.md and exchange_token_api.md;
update online_class_entry_flow.md.
BREAKING CHANGE: exchange-token endpoint moved from
/api/courses/auth/exchange-token/ to /api/account/exchange-token/.
Response shape changed: adds token, user.id is numeric, user.name
renamed to user.fullname, user.role and user.is_admin removed.
Online token response now returns a fixed URL and includes course
slug. redirect_path support removed; clients must use the returned
token for subsequent requests.
- Created a new markdown file for the online class entry flow, detailing the process for obtaining and validating tokens for online classes.
- Added a new HTML file for the prayer times calculation guide, including detailed explanations, code examples, and styling.
- Updated the multilang JSON widget HTML and Python files to include additional spacing for readability.
- Implemented a new `OnlineClassTokenManager` class in the Redis utility module to handle the generation, storage, retrieval, and deletion of temporary tokens for online classes, including methods for building entry URLs.
- Introduced a new endpoint for web user registration at 'web/register/'.
- Created WebUserRegisterSerializer to handle user registration with email and password validation.
- Enhanced UserVerifyView to support password handling during user creation and verification.
- Enhanced UserVerifyView to set user passwords securely during account creation and takeover.
- Removed the use of unusable passwords, ensuring all users have functional passwords upon verification.
- Updated UserProfileSerializer to handle password updates securely by hashing new passwords.
- Modified UserVerifyView to improve user creation and account takeover logic, ensuring unusable passwords are set for new and converted guest accounts.
- Updated UserRegisterSerializer to make device_id write-only and handle its assignment during user creation.
- Implemented email normalization in UserRegisterSerializer, UserVerifySerializer, and UserLoginSerializer to ensure case-insensitive uniqueness.
- Refactored UserRecoverPasswordSerializer to validate email format without checking for database uniqueness.
- Modified the unique_together constraint for the User model to only require uniqueness on the email field, removing device_id from the constraints.
- Added a migration to apply this change to the database schema.
- Changed device_id field in UserRegisterSerializer to be optional.
- Updated UserVerifyView to handle device_id more gracefully, allowing for None values and adjusting user creation logic accordingly.