Skip to content

Commit 36dcdad

Browse files
authored
Merge pull request #199 from vivekCS007/issue/show_new_projects
issue resolve - showing new projects dynamically
2 parents 7f1ef33 + 0985f7b commit 36dcdad

7 files changed

Lines changed: 177 additions & 317 deletions

File tree

config.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
api_endpoint = {
22
'contrihub_api_1': 'https://api.github.com/repos/ContriHUB/',
33
'contrihub_api_2': 'https://api.github.com/repos/contrihub/',
4+
'contrihub_org_repos': 'https://api.github.com/orgs/ContriHUB/repos',
45
}
56

67
html_endpoint = {

contrihub/settings.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import dj_database_url
33
from pathlib import Path
44
import os
5+
from config import api_endpoint
56

67
# Build paths inside the project like this: BASE_DIR / 'subdir'.
78
BASE_DIR = Path(__file__).resolve().parent.parent
@@ -184,8 +185,14 @@
184185
EMAIL_USE_TLS = config('EMAIL_USE_TLS', default=True, cast=bool)
185186
EMAIL_USE_SSL = config('EMAIL_USE_SSL', default=False, cast=bool)
186187

187-
AVAILABLE_PROJECTS = config('AVAILABLE_PROJECTS', default="ContriHUB-24",
188-
cast=lambda v: [s.strip() for s in v.split(',')])
188+
AVAILABLE_PROJECTS = config(
189+
'AVAILABLE_PROJECTS',
190+
default='ContriHUB-24',
191+
cast=lambda v: [s.strip() for s in v.split(',')],
192+
)
193+
194+
CONTRIHUB_ORG_REPOS_ENDPOINT = config('CONTRIHUB_ORG_REPOS_ENDPOINT', default=api_endpoint['contrihub_org_repos'])
195+
189196
LABEL_MENTOR = config('LABEL_MENTOR', default="mentor")
190197
LABEL_LEVEL = config('LABEL_LEVEL', default="level")
191198
LABEL_POINTS = config('LABEL_POINTS', default="points")

home/views.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,11 @@
2020
from user_profile.models import UserProfile
2121
from .forms import ContactForm
2222

23+
# Legacy dashboard filters: initialise globals before any view runs
24+
issues_qs = Issue.objects.none()
25+
domain = 'All'
26+
subdomain = 'All'
27+
2328

2429
def home(request):
2530
return render(request, 'home/index.html')
@@ -67,7 +72,7 @@ def filter_by_domain(request, domain_pk):
6772

6873
@complete_profile_required
6974
def filter_by_subdomain(request, subdomain_pk):
70-
global issues_qs, domain, subdomain
75+
global issues_qs, subdomain
7176
subdomain = SubDomain.objects.get(pk=subdomain_pk)
7277
project_qs = Project.objects.all()
7378
if domain != 'All':
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
# Generated by Django 4.1 on 2025-10-02 03:14
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('project', '0042_alter_issue_levelcolor'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='project',
15+
name='archived',
16+
field=models.BooleanField(default=False),
17+
),
18+
migrations.AddField(
19+
model_name='project',
20+
name='description',
21+
field=models.URLField(blank=True, verbose_name='Description'),
22+
),
23+
migrations.AddField(
24+
model_name='project',
25+
name='homepage',
26+
field=models.URLField(blank=True, verbose_name='Homepage'),
27+
),
28+
migrations.AddField(
29+
model_name='project',
30+
name='is_current',
31+
field=models.BooleanField(default=False),
32+
),
33+
migrations.AddField(
34+
model_name='project',
35+
name='pushed_at',
36+
field=models.DateTimeField(blank=True, null=True, verbose_name='Last Pushed At'),
37+
),
38+
migrations.AddField(
39+
model_name='project',
40+
name='topics_raw',
41+
field=models.TextField(blank=True, verbose_name='Topics'),
42+
),
43+
]

project/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ class Project(models.Model):
3030
api_url = models.URLField(verbose_name="API URL")
3131

3232
html_url = models.URLField(verbose_name="HTML URL")
33+
description = models.URLField(verbose_name="Description", blank=True)
34+
homepage = models.URLField(verbose_name="Homepage", blank=True)
35+
topics_raw = models.TextField(verbose_name="Topics", blank=True)
36+
pushed_at = models.DateTimeField(verbose_name="Last Pushed At", null=True, blank=True)
37+
archived = models.BooleanField(default=False)
38+
is_current = models.BooleanField(default=False)
3339
domain = models.ForeignKey(Domain, on_delete=models.DO_NOTHING, null=True, default=None)
3440
subdomain = models.ForeignKey(SubDomain, on_delete=models.DO_NOTHING, blank=True, default=None, null=True)
3541

0 commit comments

Comments
 (0)