Skip to content

Commit

Permalink
Add rockies badge
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinamstutz committed Jul 29, 2024
1 parent 5f7f337 commit b318d58
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tdm_site/projects/forms.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,6 @@ class Meta:
indy_bool = forms.BooleanField(required=False, label="INDY", widget=forms.RadioSelect(choices=((True, "Include INDY projects"), (False, "Exclude INDY projects"),)))
ndmn_bool = forms.BooleanField(required=False, label="NDMN", widget=forms.RadioSelect(choices=((True, "Include NDMN projects"), (False, "Exclude NDMN projects"),)))
online_bool = forms.BooleanField(required=False, label="NDMN", widget=forms.RadioSelect(choices=((True, "Include ONLINE projects"), (False, "Exclude ONLINE projects"), )))
rockies_bool = forms.BooleanField(required=False, label="ROCKIES", widget=forms.RadioSelect(choices=((True, "Include ROCKIES projects"), (False, "Exclude ROCKIES projects"))))


18 changes: 18 additions & 0 deletions tdm_site/projects/migrations/0017_project_rockies_bool.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Generated by Django 3.2.12 on 2024-07-29 21:22

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('projects', '0016_project_online_bool'),
]

operations = [
migrations.AddField(
model_name='project',
name='rockies_bool',
field=models.BooleanField(default=False, verbose_name='ROCKIES'),
),
]
1 change: 1 addition & 0 deletions tdm_site/projects/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ class Project(models.Model):
indy_bool = BooleanField(default=False, verbose_name=_("INDY"))
wl_bool = BooleanField(default=False, verbose_name=_("WL"))
online_bool = BooleanField(default=False, verbose_name=_("ONLINE"))
rockies_bool = BooleanField(default=False, verbose_name=_("ROCKIES"))



Expand Down
4 changes: 4 additions & 0 deletions tdm_site/projects/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def project_search_result_view(request):
ndmn_bool = request.GET.get('ndmn_bool')
indy_bool = request.GET.get('indy_bool')
online_bool = request.GET.get('online_bool')
rockies_bool = request.GET.get('rockies_bool')
#wl_bool = request.GET.get('wl_bool')

keywords = request.GET.getlist('keywords')
Expand All @@ -90,6 +91,9 @@ def project_search_result_view(request):
if indy_bool not in ['', None]:
queryset = queryset.filter(indy_bool=indy_bool)

if rockies_bool not in ['', None]:
queryset = queryset.filter(rockies_bool=rockies_bool)

#if wl_bool not in ['', None]:
# queryset = queryset.filter(wl_bool=wl_bool)

Expand Down
3 changes: 3 additions & 0 deletions tdm_site/templates/projects/project_detail.html
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
{% if project.indy_bool %}
<span class="badge rounded-pill bg-warning">INDY</span>
{% endif %}
{% if project.rockies_bool %}
<span class="badge rounded-pill bg-secondary">ROCKIES</span>
{% endif %}
{% if project.ndmn_bool %}
<span class="badge rounded-pill bg-info">NDMN/IDM</span>
{% endif %}
Expand Down
3 changes: 3 additions & 0 deletions tdm_site/templates/projects/project_list.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@ <h3>Directions</h1>
{% if project.indy_bool %}
<span class="badge rounded-pill bg-warning">INDY</span>
{% endif %}
{% if project.rockies_bool %}
<span class="badge rounded-pill bg-secondary">ROCKIES</span>
{% endif %}

{% if project.ndmn_bool %}
<span class="badge rounded-pill bg-info">NDMN/IDM</span>
Expand Down

0 comments on commit b318d58

Please sign in to comment.