Skip to content

issue resolve - showing new projects dynamically#199

Merged
lokesh-wagh merged 2 commits intoContriHUB:mainfrom
vivekCS007:issue/show_new_projects
Oct 2, 2025
Merged

issue resolve - showing new projects dynamically#199
lokesh-wagh merged 2 commits intoContriHUB:mainfrom
vivekCS007:issue/show_new_projects

Conversation

@vivekCS007
Copy link
Contributor

Description
Replaced the static “Projects in 2024” grid with a dynamic {% for project %} loop so the UI renders whatever the backend passes in.
Extended populate_projects to pull live repo metadata from the ContriHUB org, parse push timestamps, filter by recent activity/name heuristics, and fall back to the legacy allowlist only when nothing qualifies.
Stored extra GitHub data (description, homepage, topics, pushed_at) on each project and surfaced them in the card layout.
Related Issue
Fixes #194

Type of change
New feature (non-breaking change which adds functionality)
Motivation and Context
The projects page was frozen with hard-coded 2024 entries. These changes keep the page current by syncing from GitHub and rendering the data dynamically without manual edits each season.

How Has This Been Tested?
python manage.py migrate (SQLite override)
python manage.py shell → Client().login() → /project/populate_projects/ and /project/; verified HTTP 200 and non-zero is_current count.
python manage.py runserver → manual smoke test at http://127.0.0.1:8000/project/ confirming dynamic cards render with description/topics/homepage/last-updated details.
Screenshots (if appropriate):
Screenshot from 2025-10-02 10-20-15

Checklist:
✅ I have registered myself at Contrihub website.
✅ My code follows the code style of this project.
I have commented my code, particularly in hard-to-understand areas
✅ My changes generate no new warnings
My change requires a change to the documentation.
I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.
✅ Any dependent changes have been merged and published in downstream modules
I have added tests to cover my changes.
✅ All new and existing tests passed.
Test Configuration:

Firmware version: N/A
Hardware: HP Victus 16
Toolchain: Python 3.9.23 / pip 25.2
SDK: Django 4.1

@lokesh-wagh
Copy link
Contributor

how are you differentiating from the repos present in last year's contrihub from the current one

@vivekCS007
Copy link
Contributor Author

sir in the project/views.py file in line 36-67 we firstly pull repo["pushed_at"] and convert into date time format then captures current time, then it is defined in the tokens in 3-4 ways it checks within 365days of interval from the current time whether an repo's year is in currentyear-1 or not, then flag repo as current if it is.
now = timezone.now()
year_tokens = {
str(now.year),
str(now.year - 1),
str(now.year)[-2:],
str(now.year - 1)[-2:],
} this is one of code snippet

@lokesh-wagh lokesh-wagh merged commit 36dcdad into ContriHUB:main Oct 2, 2025
1 check passed
@lokesh-wagh
Copy link
Contributor

create a new PR as the dashboard crashes whenever it is opened after merging your PR

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.

Update the projects page to show the latest projects

2 participants