Skip to content

Show 6 most recent courses instead of featured courses on homepage#690

Merged
A1L13N merged 2 commits into
mainfrom
copilot/fix-e72b1558-9363-489a-9d9f-63521fdaab76
Oct 5, 2025
Merged

Show 6 most recent courses instead of featured courses on homepage#690
A1L13N merged 2 commits into
mainfrom
copilot/fix-e72b1558-9363-489a-9d9f-63521fdaab76

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Oct 5, 2025

Summary

Updated the homepage to display the 6 most recent published courses instead of the 3 courses marked as "featured". This change provides users with more current and diverse course options while simplifying the content curation process.

Changes

Backend (web/views.py)

  • Modified the index view to fetch 6 most recent published courses ordered by created_at (descending)
  • Removed the is_featured=True filter requirement
  • Increased the limit from 3 to 6 courses

Before:

# Get featured courses
featured_courses = Course.objects.filter(status="published", is_featured=True).order_by("-created_at")[:3]

After:

# Get recent courses
featured_courses = Course.objects.filter(status="published").order_by("-created_at")[:6]

Frontend (web/templates/index.html)

  • Updated section heading from "Featured Courses" to "Recent Courses"
  • Removed the star icon (⭐) that indicated featured status
  • Changed grid layout from 3 columns to 2 columns (md:grid-cols-3md:grid-cols-2) to better accommodate 6 courses in a 3×2 layout
  • Updated empty state message for clarity

Testing (web/tests/test_views.py)

  • Added comprehensive test test_index_shows_recent_courses() that:
    • Creates 8 published courses with different creation timestamps
    • Verifies exactly 6 courses are returned
    • Confirms courses are ordered by most recent first
    • Validates that featured status is no longer used as a filter

Screenshot

The homepage now displays "Recent Courses" with 6 most recent courses in a 2-column grid layout:

Recent Courses Section

Testing

✅ All 20 existing tests pass - no regressions introduced
✅ New test validates the 6 most recent courses functionality

Benefits

  • More courses visible: Users see 6 courses instead of 3, providing more learning options
  • Always fresh content: Automatically shows the latest courses without manual curation
  • Simpler maintenance: No need to manually mark courses as "featured"
  • Better discoverability: Newer courses get immediate visibility on the homepage

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • install.python-poetry.org
    • Triggering command: curl -sSL REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Instead of Featured Courses on the homepage show 6 most recent ones


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Oct 5, 2025

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.


Comment @coderabbitai help to get the list of available commands and usage tips.

Co-authored-by: A1L13N <193832434+A1L13N@users.noreply.github.com>
Copilot AI changed the title [WIP] Instead of Featured Courses on the homepage show 6 most recent ones Show 6 most recent courses instead of featured courses on homepage Oct 5, 2025
Copilot AI requested a review from A1L13N October 5, 2025 04:59
@A1L13N A1L13N marked this pull request as ready for review October 5, 2025 05:23
@A1L13N A1L13N merged commit cc3c946 into main Oct 5, 2025
1 check was pending
@A1L13N A1L13N deleted the copilot/fix-e72b1558-9363-489a-9d9f-63521fdaab76 branch October 5, 2025 05:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants