Commit graph

29 commits

Author SHA1 Message Date
037baa465b
fix(router): update DOI resolution path parameter
Changed the `identifier` parameter in the DOI resolution path to accept the full path format. This fixes issues where complex identifiers containing slashes were not resolving correctly. Ensures proper routing for a broader range of DOIs.
2024-06-25 14:12:50 +02:00
2a9d093ec6
feat: add email notifications for suffix approval process
Introduced email notifications for the suffix approval process:
- Notify prefix owners when a new suffix requires approval
- Notify users when their suffix has been approved

This helps keep stakeholders informed about the status of their suffix requests, improving transparency and workflow efficiency.
2024-06-24 13:15:42 +02:00
26d46853c4
fix(template): correct HTML structure in prefix_list
Adjusted the HTML structure in prefix_list template to fix the conditional rendering of the 'No prefixes' message. This change ensures that closing list tag renders correctly and prevents layout issues. The 'Create new prefix' button for superusers was also repositioned for better code readability.

Fixes layout glitch when no prefixes are present.
2024-06-23 17:00:04 +02:00
8abb12bb06
fix(template): correct syntax for superuser conditional
Fixed a missing space in the template's superuser conditional check. This resolves an issue where the message about contacting the administrator wasn't displayed correctly to non-superusers. This change ensures proper logic execution and clearer user instructions.
2024-06-23 16:58:11 +02:00
4f62f6eff2
feat: rate limiting and Redis caching setup
Added rate limiting to the SendLoginEmailView to prevent abuse by applying the `ratelimit` decorator. Configured Redis as a cache backend based on settings from the configuration file. Updated dependencies to include `django-ratelimit`, `redis`, and `django-redis` packages to support these enhancements.

These changes improve the security and performance of the application by limiting login email attempts and using Redis for caching.
2024-06-23 16:47:07 +02:00
4f407c2d8a
feat(settings): set DEFAULT_FROM_EMAIL for outgoing emails
Configured DEFAULT_FROM_EMAIL to "noreply@freedoi.org" to ensure all outgoing emails have a consistent sender, improving email deliverability and reducing the likelihood of emails being marked as spam.
2024-06-23 16:32:23 +02:00
c7a36d2ebe
feat(email): add email configuration support
Configured email backend to use SMTP, console, or file-based backends based on settings. Added fallback values to handle various configurations. Updated `.gitignore` to exclude email files. This enhances email handling capabilities and ensures configuration flexibility.
2024-06-23 16:24:52 +02:00
e7a7766351
feat: add local static files and update references
- Add local Bootstrap CSS and JS files to the static directory.
- Add local jQuery file to the static directory.
- Update HTML templates to reference local static files instead of CDN links.
- Load Django static files in the base template.
- Add STATIC_ROOT to Django settings for static file collection.

These changes improve website performance and reliability by serving static assets locally, avoiding dependence on external CDNs. Additionally, this facilitates easier offline development and deployment.
2024-06-23 15:24:50 +02:00
431879aea8
feat(api): add token management and serializer endpoints
Introduced endpoints for generating and managing API tokens,
enabling users to manage and regenerate their tokens via a
web interface. Added Django forms and templates to support
these functionalities.

Enhanced REST API with new endpoints for creating, updating,
and retrieving identifiers and suffixes, and included necessary
serializers.

Updated settings to include Django REST framework and token
authentication.
2024-06-23 15:10:44 +02:00
7e328f5554
feat: format html templates and update VS Code settings
Formatted multiple HTML templates in the project for better readability and maintainability. Introduced indentation, adjusted spacing, and improved overall structure without altering the business logic or functionality.

Added VS Code settings to associate HTML files with Jinja syntax highlighting to enhance the development experience.

No functional changes introduced, focused solely on code readability and development efficiency improvements.
2024-06-23 14:37:15 +02:00
1ba8f68a0e
feat(auth): refactor logout handling to custom view
Replaced Django's built-in LogoutView with a custom LogoutView. This change includes implementing the custom view in place of the previous auth_views.LogoutView. The custom view directly logs out the user and redirects to the home page.

This refactor allows greater flexibility and control over the logout process, potentially enabling additional custom logic to be added in future.
2024-06-23 11:33:56 +02:00
ce8d22a043
feat: expand and refine DOI category descriptions
Updated the category descriptions on the homepage to provide more detailed and clear classifications. Added new categories to cover a broader range of fields including Literature, Charity, Business, Government, and Personal. This enhances the educational value and usability of the prefix explanations.
2024-06-23 11:31:03 +02:00
03bfcd96bd
feat: add LOGOUT_REDIRECT_URL setting
Implemented LOGOUT_REDIRECT_URL to ensure users are redirected to the homepage after logging out, improving user experience by providing a clear redirect path. This enhancement aligns with the existing LOGIN_REDIRECT_URL settings for a consistent flow
2024-06-23 11:12:29 +02:00
05a2de7237
feat(auth): update redirect URLs for login and logout
Configured default redirection to the homepage upon login and logout actions. This improves user experience by ensuring a consistent landing page post-authentication flow.
2024-06-23 10:29:14 +02:00
6b78601b3c
feat(forms): introduce validation and error display
Added custom validation methods to ensure input integrity:
- `clean_suffix` in `PrefixForm` and `SuffixForm` now enforces numeric input with minimum digit length.
- `clean_identifier` in `IdentifierForm` restricts input to alphanumeric or specific special characters.

Updated templates to display form errors, enhancing user feedback and experience.
2024-06-23 10:24:18 +02:00
da929654c0
feat: add suffix approval workflow in admin UI
Introduced a suffix approval workflow, allowing admins to manage pending suffixes via a new approval form and pending suffix list view. Added the ability to mark suffixes as approved, updating multiple templates and views accordingly. Ensured only the relevant suffixes appear in lists based on user permissions and approval status.

- Added SuffixApprovalForm for approval actions.
- Created migration to add description field to the Suffix model.
- Updated navigation links and templates to reflect user-specific data.
- Implemented views for pending suffixes and suffix approval.

This enhancement improves the admin experience by providing streamlined management of suffix approvals.
2024-06-23 10:06:47 +02:00
fd2962cbd5
feat(models): add description field to Suffix model
Introduced a description field to the Suffix model to allow for additional information to be recorded. This enhances the granularity and informativeness of the stored data, especially useful for documentation and clarification purposes.
2024-06-23 09:40:18 +02:00
f4575ec759
feat: enhance forms with crispy-forms and Bootstrap5
Improved the user interface of various forms by integrating django-crispy-forms and crispy-bootstrap5. Updated form templates to use crispy forms for better styling and layout consistency. Removed the standalone login template in favor of using email-based login flow.

Benefits include:
- Enhanced form layout and styling using Bootstrap 5.
- Improved user experience with clearer instructions and polished designs.

Additionally, updated settings to include crispy forms and Bootstrap 5 template pack.
2024-06-23 09:36:28 +02:00
f291deece2
fix(accounts): create user if email doesn't exist
Updated the login email view to use get_or_create for retrieving user by email, ensuring a user is created if the email doesn't exist. This prevents errors when attempting to login with an unregistered email, enhancing the user experience and robustness of the login process
2024-06-23 09:23:17 +02:00
e2fddf8052
fix(ui): update login link to include registration
Updated the login link to include "Login / Register" and point to the new 'login' view instead of 'send_login_email'. This change improves user experience by clarifying the login process and emphasizing registration availability.
2024-06-23 09:11:29 +02:00
e53d7e3bc2
fix(templates): enhance login/signup and identifier creation links
Updated the login button text to "Login or Sign Up" for clarity and removed the redundant "Email Login" option on the home page. Fixed the identifier list to properly handle cases where 'suffix' might be null, ensuring correct URL generation and display formatting. These changes improve user experience and address navigation issues.
2024-06-23 09:05:29 +02:00
c70b190c23
feat: add inactive user cleanup and refine UI
Introduce a management command to delete inactive users older than 7 days. Adjust `CustomUser` model to include `date_joined` with new default settings. Enhance UI across multiple templates to improve consistency and user experience.

- Inactive user accounts cleanup enhances database hygiene.
- Updates to `CustomUser` default settings ensure consistent account states.
- Refined UI for identifier and suffix templates for better accessibility and UX.
2024-06-23 08:56:22 +02:00
31567f7bb1
feat(ui): display user email on home page
Updated the home page greeting to show the user's email instead of their first name. This change improves user identification and ensures consistency when the first name is not provided.
2024-06-22 21:18:27 +02:00
4b33f17a04
feat: enhance identifier and suffix display in lists
Updated the identifier list to display full identifier details and target URL. Improved the suffix list to show the prefix, suffix, and name together for better clarity. These changes aim to provide more comprehensive and user-friendly information in the HTML views.
2024-06-22 20:55:30 +02:00
0848d79f63
feat(homepage): enhance homepage content and structure
Revamped homepage content with improved welcome message, clear description of FreeDOI functionalities, and structured instructions for new users. Added sections for "What is FreeDOI?," "How Does It Work?," "Get Started," and "Contact Us." Enhanced user navigation and clarified the non-affiliation with the official DOI system.
2024-06-22 20:42:34 +02:00
564eecf83e
feat: pass current user to SuffixUpdateView forms
Enhances the get_form_kwargs method in SuffixUpdateView to include the current user in the form parameters. This allows for user-specific form processing and validation, ensuring forms can access and utilize the requesting user's details.
2024-06-22 19:46:00 +02:00
af3315b3f1
feat: enforce maximum suffix limit for users
Added validation in both the model and view to enforce a limit on the number of suffixes a user can create based on their maximum suffixes property. This ensures that users cannot exceed their allowed number of suffixes and maintains system integrity.
2024-06-22 19:38:13 +02:00
21d90e6cd8
feat(settings): add dynamic DB selection based on config
Updated settings to dynamically select the database backend (MySQL, MariaDB, PostgreSQL, or SQLite) based on the configuration file. This change improves flexibility and allows easier customization of the database setup by just modifying the config file.
2024-06-22 19:02:50 +02:00
dbf7cde183
feat!: initial FreeDOI project setup
- Added standard project documentation including README.md
- Added .gitignore for ignoring unnecessary files (.venv, *.pyc, etc.)
- Implemented basic Django application structure with accounts and resolver apps
- Configured Django settings, including two-factor auth and database setup
- Set up Django admin and basic model structures for Prefixes, Suffixes, Identifiers, and Permissions
- Added templates for accounts and resolver management
- Configured initial migrations and custom user model
- Included poetry dependencies and project setup configuration

This commit sets up the fundamental structure of the FreeDOI project, enabling DOI-like identifier creation and resolution.
2024-06-22 18:32:37 +02:00