-
Notifications
You must be signed in to change notification settings - Fork 11
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
Filter by blog tag #738
Filter by blog tag #738
Conversation
bea1baf
to
649df43
Compare
3f9b6e8
to
c88b971
Compare
@@ -35,6 +35,14 @@ def get_queryset(self): | |||
return qs | |||
|
|||
|
|||
class TagPostListView(PostListView): |
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.
I created this for clarity as there are multiple for_tag
methods throughout.
e8c978a
to
9f09483
Compare
Codecov ReportAll modified lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #738 +/- ##
==========================================
+ Coverage 78.57% 79.08% +0.51%
==========================================
Files 27 27
Lines 532 545 +13
==========================================
+ Hits 418 431 +13
Misses 114 114
☔ View full report in Codecov by Sentry. |
4080aca
to
6a44d35
Compare
6a44d35
to
e0d5307
Compare
<span aria-hidden="true">🏷️</span> | ||
{% for tag in post.tags %} | ||
<a href="{% url 'hermes_post_list_by_tag' tag %}">{{ tag }}</a>{% if not forloop.last %}, {% endif %} | ||
{% endfor %} |
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.
Can you render tags as a ul
& li
list? And add some CSS to show them inline rather than as a list? This will help screen readers read them out as tags.
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.
Fixed. Ran Lighthouse and the page scored 100% for navigation.
e0d5307
to
db55dca
Compare
-Render tags on post list and detail -Fix filtering -Add tags to Post list admin view -Change tag widget to multiselect
db55dca
to
5d8e588
Compare
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.
Nice! I like the way that the filtering has been done via the path rather than url params. I've checked this out locally and it seems to work as intended :)
{% if post.tags %} | ||
<span aria-hidden="true">🏷️</span> | ||
{% for tag in post.tags %} | ||
<ul> |
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.
ul
needs to be outside the loop (drive by review!)
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.
Fixed in #739
- Rename blog tags - Add custom css for tags in a list - Refactor conditional when tags exist
- Rename blog tags - Add custom css for tags in a list - Refactor conditional when tags exist
Ref #658
-Render tags on post list and detail
-Fix filtering
-Add tags to Post list admin view
-Change tag widget to multiselect with hard coded tag values
To test, edit or create 2 blog post sin the admin view. Choose a common tag for both posts as well as a unique tag for each. Save the posts and view in the list. Click the unique tags to filter.
On blog list
On blog detail