Improve empty state UI for event list page#3112
Improve empty state UI for event list page#3112Vachanbs wants to merge 2 commits intofossasia:devfrom
Conversation
Reviewer's guide (collapsed on small PRs)Reviewer's GuideEnhances the empty-state UX for the event list by replacing the single-line placeholder row with a centered, styled block that includes descriptive copy and a primary call-to-action button, all fully wrapped in Django translation tags. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 1 issue, and left some high level feedback:
- Instead of hard-coding the
href="/create", use a Django{% url %}tag pointing at the appropriate named view so this continues to work if routes change. - Align the indentation of the new
{% empty %}block with the surrounding template markup to keep the HTML structure easier to read and maintain.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Instead of hard-coding the `href="/create"`, use a Django `{% url %}` tag pointing at the appropriate named view so this continues to work if routes change.
- Align the indentation of the new `{% empty %}` block with the surrounding template markup to keep the HTML structure easier to read and maintain.
## Individual Comments
### Comment 1
<location path="app/eventyay/control/templates/control/event_list.html" line_range="70" />
<code_context>
+ <div class="text-center mt-5 text-muted">
+ <h3>{% trans "No events available" %}</h3>
+ <p>{% trans "Looks like there are no events yet." %}</p>
+ <a href="/create" class="btn btn-primary mt-3">
+ {% trans "Create Your First Event" %}
+ </a>
</code_context>
<issue_to_address>
**suggestion:** Use Django URL reversing instead of a hardcoded "/create" path
This makes the link brittle if the URL pattern changes (e.g., prefixes, namespaces, localization). Use `{% url 'event-create' %}` (or the appropriate named URL) so the template stays in sync with the URLconf.
Suggested implementation:
```
<a href="{% url 'event-create' %}" class="btn btn-primary mt-3">
```
1. Ensure that your URLconf defines a URL pattern with the name `event-create` that points to the event creation view.
2. If the actual URL name is different or namespaced (e.g., `control:event-create`), adjust the `{% url %}` tag accordingly: `{% url 'control:event-create' %}`.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
| <div class="text-center mt-5 text-muted"> | ||
| <h3>{% trans "No events available" %}</h3> | ||
| <p>{% trans "Looks like there are no events yet." %}</p> | ||
| <a href="/create" class="btn btn-primary mt-3"> |
There was a problem hiding this comment.
suggestion: Use Django URL reversing instead of a hardcoded "/create" path
This makes the link brittle if the URL pattern changes (e.g., prefixes, namespaces, localization). Use {% url 'event-create' %} (or the appropriate named URL) so the template stays in sync with the URLconf.
Suggested implementation:
<a href="{% url 'event-create' %}" class="btn btn-primary mt-3">
- Ensure that your URLconf defines a URL pattern with the name
event-createthat points to the event creation view. - If the actual URL name is different or namespaced (e.g.,
control:event-create), adjust the{% url %}tag accordingly:{% url 'control:event-create' %}.
|
We are closing this PR. This PR does not meet the minimum requirements for review.
None of this has been provided here. Without this information, reviewers would need to reproduce and verify the changes themselves, which shifts the responsibility from the contributor to the reviewer. This is not acceptable. Please ensure that future PRs:
We are happy to review once these requirements are met. |
Description
This PR improves the empty state UI of the event list page.
Previously, when no events were available, the page displayed a simple message inside a table row. This update enhances the user experience by introducing a more structured and user-friendly layout, along with a clear call-to-action button to guide users toward creating their first event.
Changes Made
{% trans %}for internationalization supportFile Modified
eventyay/app/eventyay/control/templates/control/event_list.htmlHow to Test
Run the project locally
Ensure there are no events in the database
Navigate to the event list page
Verify:
Screenshots
Impact
Improves user experience and maintains consistency with Django internationalization practices.
Summary by Sourcery
Improve the empty state experience on the event list page when no events are present.
New Features:
Enhancements: