Skip to content

Add course audience tag filter for frontpage and archive - #1536

Merged
ihalaij1 merged 1 commit into
apluslms:masterfrom
jensjvh:course-filtering
Jul 31, 2026
Merged

Add course audience tag filter for frontpage and archive#1536
ihalaij1 merged 1 commit into
apluslms:masterfrom
jensjvh:course-filtering

Conversation

@jensjvh

@jensjvh jensjvh commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

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?

  • Accessibility test using the WAVE extension.
  • Django unit tests.
  • Playwright tests.
  • Other test. (Add a description below)
  • Manual testing.

[ADD A DESCRIPTION ABOUT WHAT YOU TESTED MANUALLY]

Did you test the changes in

  • Chrome
  • Firefox
  • This pull request cannot be tested in the browser.

Think of what is affected by these changes and could become broken

Translation

Programming style

  • Did you follow our style guides?
  • Did you use Python type hinting in all functions that you added or edited? (type hints for function parameters and return values)

Have you updated the README or other relevant documentation?

  • documents inside the doc directory.
  • README.md.
  • Aplus Manual.
  • Other documentation (mention below which documentation).

Is it Done?

  • Reviewer has finished the code review
  • After the review, the developer has made changes accordingly
  • Customer/Teacher has accepted the implementation of the feature

Clean up your git commit history before submitting the pull request!

@jensjvh

jensjvh commented Jul 22, 2026

Copy link
Copy Markdown
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.

@ihalaij1 ihalaij1 self-assigned this Jul 28, 2026
@ihalaij1 ihalaij1 moved this to Under review in A+ sprints Jul 28, 2026
@ihalaij1
ihalaij1 requested review from Copilot and ihalaij1 July 28, 2026 08:38

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 index and archive pages.
  • 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.

Comment thread course/static/course/course_filter.js Outdated
Comment thread course/static/course/course_filter.js

@ihalaij1 ihalaij1 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great!

This implementation is good enough for now. It can be improved later if we decide to add more course tags.

@ihalaij1
ihalaij1 merged commit 7e19090 into apluslms:master Jul 31, 2026
6 of 8 checks passed
@github-project-automation github-project-automation Bot moved this from Under review to Done in A+ sprints Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants