Feat: Implement Server-Side Pagination and Explore page (#1175)#1193
Open
desireddymohithreddy0925 wants to merge 2 commits into
Open
Feat: Implement Server-Side Pagination and Explore page (#1175)#1193desireddymohithreddy0925 wants to merge 2 commits into
desireddymohithreddy0925 wants to merge 2 commits into
Conversation
…a#1175) - Added /explore route in main_routes.py with pagination, sorting and filtering support - Created explore.html Jinja2 template using the existing design system - Updated site navigation to link to Explore All page - Added test_explore_route to tests/test_basic.py
|
Someone is attempting to deploy a commit to the komalsony234-1530's projects Team on Vercel. A member of the Team first needs to authorize it. |
Owner
|
@desireddymohithreddy0925 kindly resolve the merge conflicts |
Author
|
@komalharshita done mam |
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.
Summary
This PR addresses issue #1175 by adding a new "Explore All" page that provides users with a comprehensive view of the entire project catalog. By implementing server-side pagination, filtering, and sorting directly in the Flask backend, we avoid overwhelming the client browser or sending the full JSON payload on every page load. The frontend features a newly created Jinja2 template (
explore.html) which leverages the existing layout architecture but introduces a new sticky sidebar containing robust filter options (Search, Level, Interest, Time, Sort) alongside pagination controls at the bottom of the grid.Related Issue
Closes #1175
Type of Change
data/projects.jsonWhat Was Changed
src/routes/main_routes.py@main.route("/explore")endpoint. Extractspage,per_page,search,level,interest,time, andsortparameters from the query string. Loops throughload_all_projects()to apply the filtering logic, applies python's nativesort()method based on user preference, and finally uses list slicing[start_idx:end_idx]to paginate the result set before serving to Jinja2.src/templates/explore.html<form method="GET">sidebar for filters on the left, and the dynamicproject-cardresults grid on the right. AddedPrevious/Nextpagination controls that preserve active filters in the URL.src/templates/index.htmltests/test_basic.pytest_explore_route()to assert that aGET /explore?page=1&per_page=5returns a HTTP200 OKstatus and properly renders the project cards within the bounds of pagination parameters.How to Test This PR
git checkout feat/issue-1175-explore-pagepip install -r requirements.txtpython app.py?page=2&level=beginner&...).Expected test output:
Test Results
Self-Review Checklist
feat/,fix/,docs/,data/,style/,test/python tests/test_basic.pyand all 28 tests passflake8 .locally and there are no errorsprint()orconsole.log()debug statementsNotes for Reviewer
None