diff --git a/scipost_django/colleges/forms.py b/scipost_django/colleges/forms.py index e3e85aa3b8113da96ee5fc5406054c7187f8eadf..a12602e9c143feefe5e487b4f9606ccb6e206ee4 100644 --- a/scipost_django/colleges/forms.py +++ b/scipost_django/colleges/forms.py @@ -563,6 +563,11 @@ class FellowshipNominationSearchForm(forms.Form): required=False, initial=True, ) + needs_specialties = forms.BooleanField( + label="Needs specialties", + required=False, + initial=False, + ) orderby = forms.ChoiceField( label="Order by", @@ -609,6 +614,7 @@ class FellowshipNominationSearchForm(forms.Form): Div(Field("can_vote"), css_class="col-auto col-lg-12 col-xl-auto"), Div(Field("voting_open"), css_class="col-auto col-lg-12 col-xl-auto"), Div(Field("has_rounds"), css_class="col-auto col-lg-12 col-xl-auto"), + Div(Field("needs_specialties"), css_class="col-auto col-lg-12 col-xl-auto"), css_class="row mb-0", ) @@ -702,6 +708,8 @@ class FellowshipNominationSearchForm(forms.Form): ) if self.cleaned_data.get("has_rounds"): nominations = nominations.filter(voting_rounds__isnull=False) + if self.cleaned_data.get("needs_specialties"): + nominations = nominations.filter(profile__specialties__isnull=True) # Ordering of nominations # Only order if both fields are set diff --git a/scipost_django/colleges/templates/colleges/_hx_nomination_summary.html b/scipost_django/colleges/templates/colleges/_hx_nomination_summary.html index aac1bdbf96fb6bd17437cc88c7bae761b9a5c7ec..6e4e24f49dc85a5e41dc1d2f7cfa1e7a332f9622 100644 --- a/scipost_django/colleges/templates/colleges/_hx_nomination_summary.html +++ b/scipost_django/colleges/templates/colleges/_hx_nomination_summary.html @@ -66,9 +66,18 @@ {% if nomination.latest_voting_round %} {% include "colleges/_hx_voting_round_summary.html" with round=nomination.latest_voting_round %} + {% else %} <div class="h-100 d-flex align-items-center justify-content-end"> - <div class="badge bg-danger fs-6">No rounds created yet</div> + <div class="badge bg-danger fs-6"> + + {% if not nomination.profile.specialties.all %} + No specialties defined yet + {% else %} + No rounds created yet + {% endif %} + + </div> </div> {% endif %}