-
-
Notifications
You must be signed in to change notification settings - Fork 282
Feat: Add recently registered orgs to registration page #4894
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Feat: Add recently registered orgs to registration page #4894
Conversation
WalkthroughThe changes implement a feature to display the five most recently registered organizations on the organization registration page. This includes adding a Changes
Sequence DiagramsequenceDiagram
participant User
participant View as RegisterOrganizationView
participant DB as Database
participant Template
User->>View: GET /register-org
View->>DB: Query 5 most recent<br/>active organizations
DB-->>View: Organizations list
View->>Template: Render with context<br/>(recent_organizations)
Template-->>User: HTML with recent orgs<br/>section + form
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes
Pre-merge checks and finishing touches✅ Passed checks (5 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
👋 Hi @Satish-Medar! This pull request needs a peer review before it can be merged. Please request a review from a team member who is not:
Once a valid peer review is submitted, this check will pass automatically. Thank you! |
|
Hi @Satish-Medar! This pull request has merge conflicts with the base branch that need to be resolved before it can be merged. To resolve the conflicts:
Once you push the resolved conflicts, this label and comment will be automatically updated. Thank you! 🙏 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
🧹 Nitpick comments (1)
website/templates/organization/register_organization.html (1)
208-237: LGTM! Well-structured recent organizations section.The implementation correctly displays the recent organizations with:
- Conditional rendering that only shows when data exists
- Responsive grid layout (1/2/3 columns)
- Proper use of semantic HTML and ARIA attributes
- Safe template variable usage with auto-escaping
- Clean integration with the new
get_absolute_url()methodOptional enhancement: Display actual organization logos
Consider displaying the actual organization logo when available instead of the generic building icon:
-<div class="flex-shrink-0 flex items-center justify-center w-16 h-16 bg-gray-200 rounded-l-md"> - <svg class="h-8 w-8 text-gray-600" - xmlns="http://www.w3.org/2000/svg" - fill="none" - viewBox="0 0 24 24" - stroke-width="1.5" - stroke="currentColor"> - <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M8.25 6h7.5m-7.5 3h7.5m-7.5 3h7.5m-7.5 3h7.5m-7.5 3h7.5" /> - </svg> -</div> +<div class="flex-shrink-0 flex items-center justify-center w-16 h-16 bg-gray-200 rounded-l-md overflow-hidden"> + {% if org.logo %} + <img src="{{ org.logo.url }}" alt="{{ org.name }} logo" class="h-full w-full object-cover"> + {% else %} + <svg class="h-8 w-8 text-gray-600" + xmlns="http://www.w3.org/2000/svg" + fill="none" + viewBox="0 0 24 24" + stroke-width="1.5" + stroke="currentColor"> + <path stroke-linecap="round" stroke-linejoin="round" d="M3.75 21h16.5M4.5 3h15M5.25 3v18m13.5-18v18M8.25 6h7.5m-7.5 3h7.5m-7.5 3h7.5m-7.5 3h7.5m-7.5 3h7.5" /> + </svg> + {% endif %} +</div>This would make the section more visually distinctive while maintaining the clean fallback.
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Knowledge base: Disabled due to Reviews -> Disable Knowledge Base setting
📒 Files selected for processing (3)
website/models.py(1 hunks)website/templates/organization/register_organization.html(3 hunks)website/views/company.py(1 hunks)
🔇 Additional comments (3)
website/views/company.py (1)
136-138: LGTM! Clean implementation of the recent organizations feature.The query logic correctly fetches the 5 most recently created active organizations. The use of
is_active=Truefilter is appropriate since organizations are set to active upon creation (line 182 in the POST method).website/models.py (1)
233-234: LGTM! Standard Django pattern for canonical URLs.The method correctly returns the absolute URL using the organization's slug. The slug is guaranteed to exist due to the
save()method (lines 219-231) which auto-generates unique slugs when needed.website/templates/organization/register_organization.html (1)
263-320: LGTM! Improved notification handling with default info branch.The addition of the
{% else %}branch provides complete coverage for messages that don't match the standard error/warning/success levels. The info-style styling with thefa-info-circleicon is appropriate and maintains consistency with the existing notification patterns.
❌ Pre-commit checks failedThe pre-commit hooks found issues that need to be fixed. Please run the following commands locally to fix them: # Install pre-commit if you haven't already
pip install pre-commit
# Run pre-commit on all files
pre-commit run --all-files
# Or run pre-commit on staged files only
pre-commit runAfter running these commands, the pre-commit hooks will automatically fix most issues. 💡 Tip: You can set up pre-commit to run automatically on every commit by running: pre-commit installPre-commit outputFor more information, see the pre-commit documentation. |
Closes #4802
This is a new, clean PR for the "Recently Registered Organizations" feature, as requested by @DonnieBLT.
The previous PR (#4801) was closed due to including unrelated files and merge conflicts. This new PR contains only the 3 files necessary for the feature, has been fully formatted, and is 100% clean.
The code has been tested locally and is working as expected.
Summary by CodeRabbit
Release Notes
New Features
Improvements