Add course audience tag filter for frontpage and archive - #1536
Merged
Conversation
Contributor
Author
|
Right now this is very hard coded, and would probably need to be refactored if many new course tags are added. Let me know if you have a better idea on how to do this. |
There was a problem hiding this comment.
Pull request overview
Adds a client-side “course audience” (enrollment audience) filter UI to the course front page and course archive views, allowing users to quickly narrow visible course cards by audience tag.
Changes:
- Add a dropdown checkbox filter UI (“Filter courses”) to
indexandarchivepages. - Expose enrollment audience choices and labels to templates and annotate course cards with
data-audience. - Implement the filtering logic in a new JS file and add the related i18n strings.
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| locale/fi/LC_MESSAGES/django.po | Adds Finnish translation for the new filter UI label (and updates POT metadata/wrapping). |
| locale/en/LC_MESSAGES/django.po | Adds English translation for the new filter UI label (and updates POT metadata/wrapping). |
| course/views.py | Provides course_tag_choices and audience labels to the front page and archive templates. |
| course/templates/course/index.html | Includes the new filter UI on the front page. |
| course/templates/course/archive.html | Includes the new filter UI alongside the search on the archive page. |
| course/templates/course/_filter_courses_form.html | New partial for the dropdown checkbox filter and script include. |
| course/templates/course/_course_cards.html | Adds data-audience attribute to course cards for JS filtering. |
| course/static/course/course_filter.js | New client-side logic to show/hide cards based on selected audiences. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ihalaij1
force-pushed
the
course-filtering
branch
from
July 31, 2026 11:05
d0f6e03 to
0456dbe
Compare
ihalaij1
force-pushed
the
course-filtering
branch
from
July 31, 2026 11:08
0456dbe to
f292892
Compare
ihalaij1
approved these changes
Jul 31, 2026
ihalaij1
left a comment
Contributor
There was a problem hiding this comment.
Great!
This implementation is good enough for now. It can be improved later if we decide to add more course tags.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
What?
Add a dropdown for filtering courses by their tag (currently Aalto, MOOC, Aalto and MOOC) on the front page and archive views.
Why?
[ANSWER HERE]
How?
JavaScript filter with the tag choices hard coded.
Implements #580
Testing
Remember to add or update unit tests for new features and changes.
What type of test did you run?
[ADD A DESCRIPTION ABOUT WHAT YOU TESTED MANUALLY]
Did you test the changes in
Think of what is affected by these changes and could become broken
Translation
Programming style
Have you updated the README or other relevant documentation?
Is it Done?
Clean up your git commit history before submitting the pull request!