Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Liliane and Bineta changed the Kiosk route #928

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/controllers/events/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def email():
flash(message, status)
return redirect(url_for("main.events", selectedTerm = raw_form_data['selectedTerm']))

@events_bp.route('/eventsList/<eventid>/kiosk', methods=['GET'])
@events_bp.route('/event/<eventid>/kiosk', methods=['GET'])
def loadKiosk(eventid):
"""Renders kiosk for specified event."""
event = Event.get_by_id(eventid)
Expand Down
225 changes: 104 additions & 121 deletions app/templates/events/trackVolunteers.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,57 +2,59 @@
{% extends "base.html"%}

{% block scripts %}
{{super()}}
<script type="module" src="/static/js/trackVolunteers.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.11.3/r-2.2.9/datatables.min.js"></script>
{{super()}}
<script type="module" src="/static/js/trackVolunteers.js"></script>
<script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.11.3/r-2.2.9/datatables.min.js"></script>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Somehow a lot the indentation on this page was messed up. Not sure how. We need to reset that back to the way it was

{% endblock %}

{% block styles %}

{{super()}}
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.11.3/r-2.2.9/datatables.min.css"/>
{{super()}}
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.11.3/r-2.2.9/datatables.min.css" />

{% endblock %}

{% block app_content %}

<div class="text-center">
{% set page_title = eventData.name %}
<h1 id="title">{{page_title}}</h1>
{% if eventData.name != 'All Volunteer Training' and eventData.program == None %}
<h3>CELTS-Sponsored Event</h3>
{% elif eventData.program %}
<h3>{{eventData["program"].programName}} Event</h3>
{% endif %}
{% if event.isPast %}
<div class="alert-danger mb-2 pb-2 pt-2" role="alert">This event is in the past.</div>
{% endif %}
<h1 id="title">{{page_title}}</h1>
{% if eventData.name != 'All Volunteer Training' and eventData.program == None %}
<h3>CELTS-Sponsored Event</h3>
{% elif eventData.program %}
<h3>{{eventData["program"].programName}} Event</h3>
{% endif %}
{% if event.isPast %}
<div class="alert-danger mb-2 pb-2 pt-2" role="alert">This event is in the past.</div>
{% endif %}
</div>
<div class="btn-group">
<ul class="nav nav-tabs nav-fill mx-3 mb-3" id="pills-tab" role="tablist">
<li class="nav-item" role="presentation">
<a class="nav-link" href="/eventsList/{{event.id}}/view" role="tab" aria-selected="false">View Event</a>
<a class="nav-link" href="/eventsList/{{event.id}}/view" role="tab" aria-selected="false">View Event</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link active" href="#" role="tab" aria-selected="true">Track Volunteers</a>
<a class="nav-link active" href="#" role="tab" aria-selected="true">Track Volunteers</a>
</li>
<li class="nav-item" role="presentation">
<a class="nav-link" href="/eventsList/{{event.id}}/edit" role="tab" aria-selected="false">Edit Event</a>
<a class="nav-link" href="/eventsList/{{event.id}}/edit" role="tab" aria-selected="false">Edit Event</a>
</li>
</ul>
</div>
<label class='d-none' id="eventLength">{{eventLength}}</label>
<input class="form-control" id="event" name="event" value="{{event}}" type='hidden' />
<div class="flex-container" style="padding: 5px;">
<div class='form-group d-inline-flex'>
<a class="btn btn-success" role="button" href="#" data-bs-toggle="modal" data-bs-target="#addVolunteerModal" style="margin:5px;">Add Volunteer</a>
<a class="btn btn-success" role="button" href="#" data-bs-toggle="modal" data-bs-target="#addVolunteerModal"
style="margin:5px;">Add Volunteer</a>
{% if event.isRecurring and not event.isFirstRecurringEvent%}
{% if recurringVolunteers | count == 0 %}
{% set disabled = "disabled" %}
{% endif %}
<button type="button" class="btn btn-success" id="pastVolunteers" data-bs-toggle="modal" data-bs-target= "#addPastVolunteerModal" style="margin:5px;" {{disabled}}>Add Past Volunteers</button>
{% if recurringVolunteers | count == 0 %}
{% set disabled = "disabled" %}
{% endif %}
<button type="button" class="btn btn-success" id="pastVolunteers" data-bs-toggle="modal"
data-bs-target="#addPastVolunteerModal" style="margin:5px;" {{disabled}}>Add Past Volunteers</button>
{%endif%}
<a class="btn btn-warning" role="button" href= "/eventsList/{{event.id}}/kiosk" style="margin:5px;">Kiosk Entry</a>
<a class="btn btn-warning" role="button" href="/event/{{event.id}}/kiosk" style="margin:5px;">Kiosk Entry</a>
</div>
</div>
<form method="post">
Expand All @@ -61,102 +63,80 @@ <h3>{{eventData["program"].programName}} Event</h3>
<table class="table" id="trackVolunteerstable">
<thead>
<tr>
{% if (not event.isPast) and (event.isRsvpRequired) %}
<th>RSVP Time</th>
{% if (not event.isPast) and (event.isRsvpRequired) %}
<th>RSVP Time</th>
{% endif %}
<th>Name</th>
<th>Email</th>
<th>Phone Number</th>
<th class="noSort">Completed Trainings</th>
{% if event.isPast %}
<th class="noSort">Total Hours</th>
<th class="noSort">Attended</th>
<th class="noSort">Total Hours</th>
<th class="noSort">Attended</th>
{% endif %}
<th class="noSort">Remove Volunteer</th>
</tr>
</thead>
<tbody class="align-middle" id="volunteerTable">
{% if eventVolunteerData %}
{% if eventVolunteerData %}
{% for participant in eventVolunteerData %}
<tr>
{% if (not event.isPast) and (event.isRsvpRequired) %}
<td>
{# This only works because we are assuming that all participants are RSVP entries #}
{{ participant.rsvpTime.strftime('%b %-d %-I:%M %p') }}
</td>
<tr>
{% if (not event.isPast) and (event.isRsvpRequired) %}
<td>
{# This only works because we are assuming that all participants are RSVP entries #}
{{ participant.rsvpTime.strftime('%b %-d %-I:%M %p') }}
</td>
{% endif %}
<td>
<input class="form-control" type='hidden' name="username{{loop.index|string}}"
id="{{participant.user.username}}" value="{{participant.user}}" />
{{participant.user.firstName}} {{participant.user.lastName}}
{% if participant.user in bannedUsers %}
<a href="#" data-toggle="tooltip" data-placement="top" title="User is banned from this program.">
<span class="bi bi-x-circle-fill text-danger"></span>
</a>
{% endif %}
<td>
<input
class="form-control"
type='hidden'
name="username{{loop.index|string}}"
id="{{participant.user.username}}"
value="{{participant.user}}" />
{{participant.user.firstName}} {{participant.user.lastName}}
{% if participant.user in bannedUsers %}
<a href="#" data-toggle="tooltip" data-placement="top" title="User is banned from this program.">
<span class="bi bi-x-circle-fill text-danger"></span>
</a>
{% endif %}
</td>
<td>{{participant.user.email}}</td>
<td>{{participant.user.phoneNumber}}</td>
<td style="text-align:center">
{% if participant.user.username not in trainedParticipantsList %}
<span class="bi bi-x-lg" aria-label="Did not complete all trainings."></span>
{% else %}
<span class="bi bi-check-lg" aria-label="Completed all trainings."></span>
{% endif %}
</td>
{% if event.isPast %}
<td>
<input
class="form-control number-only form-control input-sm"
id="inputHours_{{participant.user.username}}"
name="inputHours_{{participant.user.username}}"
style="max-width: 90px;"
type ="number"
min="0"
step="0.01"
{% if participant.user in eventParticipants and eventParticipants[participant.user.username] == None %}
value="{{eventLength}}"
{% elif participant.user in eventParticipants %}
value="{{participant.hoursEarned}}"
{% else %} disabled {% endif %}
/>
</td>
<td style="text-align:center">
<input
type="checkbox"
class='attendanceCheck'
name="checkbox_{{participant.user.username}}"
{% if event.isPast %}
{% if participant.user in eventParticipants %}
checked
{% endif %}
{% endif %} />
</td>
{% endif %} {# end hiding the hours and attended inputs #}
<td style="text-align:center">
<button
type="button"
class="removeVolunteer btn btn-danger btn-sm"
id="{{participant.user.username}}"
aria-label="remove volunteer">
<span class="bi bi-trash h5 align-middle"></span>
</button>
</td>
</tr>
{% endfor %}
</td>
<td>{{participant.user.email}}</td>
<td>{{participant.user.phoneNumber}}</td>
<td style="text-align:center">
{% if participant.user.username not in trainedParticipantsList %}
<span class="bi bi-x-lg" aria-label="Did not complete all trainings."></span>
{% else %}
<span class="bi bi-check-lg" aria-label="Completed all trainings."></span>
{% endif %}
</td>
{% if event.isPast %}
<td>
<input class="form-control number-only form-control input-sm" id="inputHours_{{participant.user.username}}"
name="inputHours_{{participant.user.username}}" style="max-width: 90px;" type="number" min="0" step="0.01"
{% if participant.user in eventParticipants and eventParticipants[participant.user.username]==None %}
value="{{eventLength}}" {% elif participant.user in eventParticipants %} value="{{participant.hoursEarned}}"
{% else %} disabled {% endif %} />
</td>
<td style="text-align:center">
<input type="checkbox" class='attendanceCheck' name="checkbox_{{participant.user.username}}" {% if
event.isPast %} {% if participant.user in eventParticipants %} checked {% endif %} {% endif %} />
</td>
{% endif %} {# end hiding the hours and attended inputs #}
<td style="text-align:center">
<button type="button" class="removeVolunteer btn btn-danger btn-sm" id="{{participant.user.username}}"
aria-label="remove volunteer">
<span class="bi bi-trash h5 align-middle"></span>
</button>
</td>
</tr>
{% endfor %}
{% endif %}
</tbody>
</table>
</tbody>
</table>
<div>
<button type="submit" class="btn btn-primary float-end">Save</button>
</div>
</form>
<!-- Modal -->
<div class="modal fade float-start" id="addVolunteerModal" tabindex="-1" aria-labelledby="addVolunteerModalLabel" aria-hidden="true">
<div class="modal fade float-start" id="addVolunteerModal" tabindex="-1" aria-labelledby="addVolunteerModalLabel"
aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
Expand All @@ -166,15 +146,15 @@ <h5 class="modal-title" id="exampleModalLabel">Add a volunteer</h5>
<div class="modal-body">
<div class="input-group">
<div class="form-group input-group-x form-outline ui-widget" style="width:80%;">
<input type="input" id="addVolunteerInput" class="form-control" placeholder="Search" autocomplete="off"/>
<input type="input" id="addVolunteerInput" class="form-control" placeholder="Search" autocomplete="off" />
</div>
<button type="button" class="btn btn-primary btn-sm">
<i class="bi bi-search ms-0"></i>
</button>
</div>
<br>
<h5>Selected Volunteers</h5>
<ul class="list-unstyled" id= "addVolunteerList">
<ul class="list-unstyled" id="addVolunteerList">
</ul>
</div>
<div class="modal-footer">
Expand All @@ -185,29 +165,32 @@ <h5>Selected Volunteers</h5>
</div>
</div>
<!-- Modal for Add Past Volunteers-->
<div class="modal fade float-start" id="addPastVolunteerModal" tabindex="-1" aria-labelledby="addPastVolunteerModalLabel" aria-hidden="true">
<div class="modal fade float-start" id="addPastVolunteerModal" tabindex="-1"
aria-labelledby="addPastVolunteerModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<form action="/addVolunteersToEvent/{{event.id}}" method="POST">
<div class="modal-header">
<h5 class="modal-title">Add Past Volunteers</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body pl-5">
{%for participant in recurringVolunteers%}
<table>
<input class="m-2" type="checkbox" id ="recurringVolunteerCheckbox_{{loop.index}}" name="volunteer[]" value= {{participant}} />
<label class="form-check-label" for="recurringVolunteerCheckbox_{{loop.index}}"> {{participant.firstName}} {{participant.lastName}} </label>
</table>
{% endfor %}
</div>
<div class="modal-footer" >
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close </button>
<button type="button" id = "selectAllVolunteers" class="btn btn-secondary" >Select All</button>
<button id="AddPastVolunteerButton" type="submit" class="btn btn-primary" >Add Volunteers</button>
</div>
<div class="modal-header">
<h5 class="modal-title">Add Past Volunteers</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body pl-5">
{%for participant in recurringVolunteers%}
<table>
<input class="m-2" type="checkbox" id="recurringVolunteerCheckbox_{{loop.index}}" name="volunteer[]"
value={{participant}} />
<label class="form-check-label" for="recurringVolunteerCheckbox_{{loop.index}}"> {{participant.firstName}}
{{participant.lastName}} </label>
</table>
{% endfor %}
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close </button>
<button type="button" id="selectAllVolunteers" class="btn btn-secondary">Select All</button>
<button id="AddPastVolunteerButton" type="submit" class="btn btn-primary">Add Volunteers</button>
</div>
</form>
</div>
</div>
</div>
{% endblock %}
{% endblock %}