diff --git a/app/controllers/admin/volunteers.py b/app/controllers/admin/volunteers.py index 2dbe81479..cf730ea73 100644 --- a/app/controllers/admin/volunteers.py +++ b/app/controllers/admin/volunteers.py @@ -115,11 +115,12 @@ def volunteerDetailsPage(eventID): waitlistUser = list(set([obj for obj in eventRsvpData if obj.rsvpWaitlist])) rsvpUser = list(set([obj for obj in eventRsvpData if not obj.rsvpWaitlist ])) - + attendedUser = list(set([obj for obj in eventParticipantData if not obj.rsvpWaitlist])) + return render_template("/events/volunteerDetails.html", waitlistUser = waitlistUser, - attendedUser= eventParticipantData, - rsvpUser= rsvpUser, + attendedUser = attendedUser, + rsvpUser = rsvpUser, event = event) diff --git a/app/logic/participants.py b/app/logic/participants.py index 630ea0aea..b0933a959 100644 --- a/app/logic/participants.py +++ b/app/logic/participants.py @@ -193,8 +193,8 @@ def sortParticipantsByStatus(event): # if rsvp is required for the event, grab all volunteers that are in the waitlist eventWaitlistData = [volunteer for volunteer in (eventParticipants + eventRsvpData) if volunteer.rsvpWaitlist and event.isRsvpRequired] - # put the rest of the users that are not on the waitlist into the volunteer data - eventVolunteerData = [volunteer for volunteer in eventNonAttendedData if volunteer not in eventWaitlistData] + # put all participants and non-waitlisted RSVPs into the volunteer data + eventVolunteerData = [volunteer for volunteer in (eventParticipants + eventNonAttendedData) if volunteer not in eventWaitlistData] eventNonAttendedData = [] return eventNonAttendedData, eventWaitlistData, eventVolunteerData, eventParticipants \ No newline at end of file diff --git a/app/templates/events/volunteerDetails.html b/app/templates/events/volunteerDetails.html index d3d77b885..e198f4809 100644 --- a/app/templates/events/volunteerDetails.html +++ b/app/templates/events/volunteerDetails.html @@ -59,20 +59,29 @@

{{ participant.user.firstName }} {{ participant {% macro printParticipants(type, attended, rsvp, waitlist) %} {% set combinedParticipants = attended + rsvp + waitlist %} {% for p in combinedParticipants | unique %} - {% if p in rsvp %} + {% if p in rsvp and not event.isRsvpRequired %} + {{createTable(p, 'invited') if type == 'table' else createCard(p, 'invited') }} + {% endif %} + {% if p in rsvp and event.isRsvpRequired %} {{createTable(p, 'rsvp') if type == 'table' else createCard(p, 'rsvp') }} {% endif %} {% if p in attended%} {{createTable(p, 'attended') if type == 'table' else createCard(p, 'attended') }} {% endif %} {% if p in waitlist %} - {{createTable(p, 'waitlist') if type == 'table' else createCard(p, 'waitlist') }} + {{createTable(p, 'waitlisted') if type == 'table' else createCard(p, 'waitlisted') }} {% endif %} {% endfor %} {% endmacro %} {% macro createCheckbox(checkboxName) %} - {% set labelText = "RSVP" if checkboxName == 'rsvp' else 'Waitlist' if checkboxName == 'waitlist' else 'Attended' %} + {%- set labelMap = { + 'rsvp': 'RSVP', + 'waitlist': 'Waitlisted', + 'attended': 'Attended', + 'invited': 'Invited' + } -%} + {% set labelText = labelMap.get(checkboxName, 'Invited') %}
{% endmacro %} @@ -94,7 +103,7 @@


- {% if rsvpUser %} + {% if rsvpUser and event.isRsvpRequired %} {{createCheckbox('rsvp')}} {% endif %} {% if waitlistUser %} @@ -103,6 +112,9 @@

{% if attendedUser %} {{createCheckbox('attended')}} {% endif %} + {% if rsvpUser and not event.isRsvpRequired %} + {{createCheckbox('invited')}} + {% endif %}