diff --git a/scipost_django/colleges/templates/colleges/_hx_nominations_invitations.html b/scipost_django/colleges/templates/colleges/_hx_nominations_invitations.html index 571c482c2acae08b0da096fd764ac74d1877f026..0b9771d42358f9ae2dfc18ef4e4841716a0b4a90 100644 --- a/scipost_django/colleges/templates/colleges/_hx_nominations_invitations.html +++ b/scipost_django/colleges/templates/colleges/_hx_nominations_invitations.html @@ -1,7 +1,9 @@ {% include 'colleges/_hx_nominations_invitations_tablist.html' with selected=selected %} {% for invitation in invitations.all %} - <details class="m-2 mt-4 border border-2"> + <details id="invitation-{{ invitation.id }}-details" + class="m-2 mt-4 border border-2" + > <summary class="bg-light p-2">{{ invitation }}</summary> <details class="m-2 mt-4 border"> <summary class="p-2 bg-light">Events for this nomination</summary> @@ -30,7 +32,7 @@ <h4>Update the response to this invitation:</h4> <div id="invitation-{{ invitation.id }}-update-response" hx-get="{% url 'colleges:_hx_fellowship_invitation_update_response' invitation_id=invitation.id %}" - hx-trigger="revealed" + hx-trigger="toggle from:#invitation-{{ invitation.id }}-details" hx-target="this" > </div> diff --git a/scipost_django/colleges/templates/colleges/_hx_nominations_needing_specialties.html b/scipost_django/colleges/templates/colleges/_hx_nominations_needing_specialties.html index d4b5b7001a42d2ad8cfe966842755e70cb32878d..50d4c6abf771e0ad1cd8728ebe3f38401f3a038a 100644 --- a/scipost_django/colleges/templates/colleges/_hx_nominations_needing_specialties.html +++ b/scipost_django/colleges/templates/colleges/_hx_nominations_needing_specialties.html @@ -1,10 +1,12 @@ {% for nomination in nominations_needing_specialties %} - <details class="border border-2 mt-4"> + <details id="nomination-{{ nomination.id }}-specialties" + class="border border-2 mt-4" + > <summary class="p-2 bg-light">{{ nomination }}</summary> <div id="profile-{{ nomination.profile.id }}-specialties" class="p-2 mt-2" hx-get="{% url 'profiles:_hx_profile_specialties' profile_id=nomination.profile.id %}" - hx-trigger="revealed" + hx-trigger="toggle from:#nomination-{{ nomination.id }}-specialties" > </div> <button class="btn btn-success text-white m-2" diff --git a/scipost_django/colleges/templates/colleges/nominations.html b/scipost_django/colleges/templates/colleges/nominations.html index 97edb580e4efff2e9697bba231eea3e67cf1350a..47dc3a937191affd4c2fa88cdee24449a18346a0 100644 --- a/scipost_django/colleges/templates/colleges/nominations.html +++ b/scipost_django/colleges/templates/colleges/nominations.html @@ -84,7 +84,9 @@ </details> {% if "edadmin" in user_roles or "active_senior_fellow" in user_roles %} - <details class="border border-danger border-2 mt-4"> + <details id="ensure-specialties-details" + class="border border-danger border-2 mt-4" + > <summary class="bg-danger bg-opacity-10 p-2"> <h2 class="ms-2"> <strong class="text-danger">EdAdmin/Senior Fellows</strong>: @@ -93,21 +95,23 @@ <div class="p-2 mt-2"> <div id="nominations_needing_specialties" hx-get="{% url 'colleges:_hx_nominations_needing_specialties' %}" - hx-trigger="revealed" + hx-trigger="toggle from:#ensure-specialties-details" > </div> </div> </details> {% endif %} - <details class="border border-primary border-2 mt-4"> + <details id="voting-details" + class="border border-primary border-2 mt-4" + > <summary class="bg-primary bg-opacity-10 p-2"> <h2 class="ms-2 text-primary">Vote{% if 'edadmin' in user_roles %} <span class="text-danger">(EdAdmin: manage voting)</span>{% endif %}</h2> </summary> <div class="p-2 mt-2"> <div id="voting_tablist" hx-get="{% url 'colleges:_hx_voting_rounds' %}?tab={% if 'edadmin' in user_roles %}ongoing{% else %}ongoing-vote_required{% endif %}" - hx-trigger="load" + hx-trigger="toggle from:#voting-details" hx-target="this" hx-swap="innerHTML" > @@ -116,7 +120,9 @@ </details> {% if "edadmin" in user_roles %} - <details class="border border-success border-2 mt-4"> + <details id="invitations-details" + class="border border-success border-2 mt-4" + > <summary class="bg-success bg-opacity-10 p-2"> <h2 class="ms-2"> <strong class="text-success">EdAdmin</strong>: @@ -125,7 +131,7 @@ <div class="p-2 mt-2"> <div id="invitations_tablist" hx-get="{% url 'colleges:_hx_nominations_invitations' %}?response=notyetinvited" - hx-trigger="load" + hx-trigger="toggle from:#invitations-details" hx-target="this" hx-swap="innerHTML" > @@ -134,14 +140,16 @@ </details> {% endif %} - <details class="border border-2 mt-4"> + <details id="list-details" + class="border border-2 mt-4" + > <summary class="bg-light p-2"> <h2 class="ms-2">List / filter</h2> </summary> <div class="p-2 mt-2"> <form hx-post="{% url 'colleges:_hx_nominations' %}" - hx-trigger="load, keyup delay:500ms, change" + hx-trigger="toggle from:#list-details, keyup delay:500ms, change" hx-target="#search-nominations-results" hx-indicator="#indicator-search" > diff --git a/scipost_django/colleges/views.py b/scipost_django/colleges/views.py index a18abea68e33aec894b9c9efbcba1f7d245ad260..44870dd252a493f68bbed73f534d2b34318fc370 100644 --- a/scipost_django/colleges/views.py +++ b/scipost_django/colleges/views.py @@ -960,7 +960,6 @@ def _hx_fellowship_invitation_update_response(request, invitation_id): form.cleaned_data["response"], ) ) - context = {"invitation": invitation, "form": form,} return render( request, diff --git a/scipost_django/scipost/forms.py b/scipost_django/scipost/forms.py index 2af2ae31b3a1203e76094a5cac56a2a59236192d..1b2148bb39b0bf6708cdd3a0139926976bf73313 100644 --- a/scipost_django/scipost/forms.py +++ b/scipost_django/scipost/forms.py @@ -204,7 +204,7 @@ class RegistrationForm(forms.Form): ) profile = Profile.objects.filter( - emails__email__icontains=self.cleaned_data["email"] + emails__email__iexact=self.cleaned_data["email"] ).first() try: if profile and profile.contributor: