Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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: 0 additions & 2 deletions app/models/user.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
from app.models import *


class User(baseModel):
username = CharField(primary_key=True)
bnumber = CharField(unique=True)
Expand Down Expand Up @@ -80,4 +79,3 @@ def isProgramManagerForEvent(self, event):
# Looks to see who the Program Manager for a specific event is
return self.isProgramManagerFor(event.program)


17 changes: 17 additions & 0 deletions app/static/js/userProfile.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
$(document).ready(function(){
$("#checkDietRestriction").on("change", function() {
let norestrict = $(this).is(':checked');
if (norestrict) {
$("#dietContainer").hide();
$("#diet").val("No dietary restrictions");

} else {
$("#dietContainer").show();
}
});


$("#expressInterest").on("click", function() {
let username = $(this).data('username')
let isAdding = $(this).is(':checked');
Expand All @@ -16,6 +28,7 @@ $(document).ready(function(){
msgToast("Error!", "Failed to save changes!")
}
});

})

$("#printButton").on("click", function() {
Expand Down Expand Up @@ -362,4 +375,8 @@ function updateManagers(el, volunteerUsername ){// retrieve the data of the stud
console.log(error, status)
}
})


}


11 changes: 5 additions & 6 deletions app/templates/events/volunteerDetails.html
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ <h4 class="nameSelect" nowrap><b>{{ participant.user.firstName }} {{ participant
<div class="phoneSelect" nowrap>{{ participant.user.phoneNumber if participant.user.phoneNumber else "No phone number"}}</div>
<div class="emailSelect" nowrap>{{ participant.user.email }}</div>
<div class="statusSelect" nowrap>Volunteer Status: {{ volunteerType|title }}</div>
<div class="dietRestrictionSelect">Dietary Restrictions: {{ participant.user.dietRestriction if participant.user.dietRestriction else "None Specified" }}</div>
<div class="dietRestrictionSelect">Dietary Restrictions: {{ participant.user.dietRestriction if participant.user.dietRestriction else "Yet to be indicated" }}</div>
<div class="emergencyContactSelect" nowrap>Emergency Contact: {{participant.emergencycontact.name if participant.emergencycontact}}
{{participant.emergencycontact.cellPhone or participant.emergencycontact.homePhone or participant.emergencycontact.workPhone if participant.emergencycontact}}
{{"None Specified" if not participant.emergencycontact}}</div>
{{"Yet to be indicated" if not participant.emergencycontact}}</div>
<div class="insuranceSelect" nowrap>Insurance Info: {{participant.insuranceinfo.insuranceCompany if participant.insuranceinfo}}</div>
</ul>
</div>
Expand All @@ -49,8 +49,7 @@ <h4 class="nameSelect" nowrap><b>{{ participant.user.firstName }} {{ participant
<td class="phoneSelect" nowrap>{{ participant.user.phoneNumber if participant.user.phoneNumber else "" }}</td>
<td class="emailSelect" nowrap>{{ participant.user.email }}</td>
<td class="statusSelect" nowrap>{{ volunteerType|title if volunteerType != 'rsvp' else volunteerType|upper}}</td>
<td class="dietRestrictionSelect">{{ participant.user.dietRestriction if participant.user.dietRestriction else ''}}</td>

<td class="dietRestrictionSelect">{{ participant.user.dietRestriction if participant.user.dietRestriction else 'Yet to be indicated'}}</td>
<td class="emergencyContactSelect">{{participant.emergencycontact.name if participant.emergencycontact}}
{{participant.emergencycontact.cellPhone or participant.emergencycontact.homePhone or participant.emergencycontact.workPhone if participant.emergencycontact}} </td>
<td class="insuranceSelect" nowrap>{{ participant.insuranceinfo.policyNumber if participant.insuranceinfo}}</td>
Expand Down Expand Up @@ -108,7 +107,7 @@ <h3 style="text-align: center; width:180%;">
<div class="col">
<label><b>Included Information:</b></label><br>
<input class="displayCheckbox noprint" type="checkbox" name="selected_items" id="dietRestrictionSelect" checked>
<label for="dietRestrictionSelect">Dietary Restriction</label><br>
<label for="dietRestrictionSelect">Dietary Restrictions</label><br>
<input class="displayCheckbox noprint" type="checkbox" name="selected_items" id="emergencyContactSelect" checked>
<label for="emergencyContactSelect">Emergency Contact</label><br>
<input class="displayCheckbox noprint" type="checkbox" name="selected_items" id="phoneSelect" checked>
Expand Down Expand Up @@ -149,7 +148,7 @@ <h3 style="text-align: center; width:180%;">
<th class="phoneSelect">Phone Number</th>
<th class="emailSelect">Email</th>
<th class="statusSelect">Volunteer Status</th>
<th class="dietRestrictionSelect">Dietary Restriction</th>
<th class="dietRestrictionSelect">Dietary Restrictions</th>
<th class="emergencyContactSelect">Emergency Contact</th>
<th class="insuranceSelect">Insurance Information</th>
</tr>
Expand Down
12 changes: 9 additions & 3 deletions app/templates/main/userProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -445,8 +445,14 @@ <h3 class="accordion-header" id="headingSeven">
<div class="container">
<form>
<div class="form-group">
<label for="usr">Please enter any dietary restrictions you have:</label>
<textarea class="form-control" id="diet" placeholder="Dietary Restrictions">{%if volunteer.dietRestriction%}{{volunteer.dietRestriction}}{%endif%}</textarea>
<div class=" form-check form-switch mb-2">
<label class="custom-control-label" for="checkDietRestriction"><strong> No dietary restrictions</strong></label>
<input class="form-check-input" type="checkbox" id="checkDietRestriction" name="DietRestriction" {{"checked" if (volunteer.dietRestriction == "No dietary restrictions")}} />
</div>
<div id="dietContainer">
<label for="usr">Please enter any dietary restrictions you have:</label>
<textarea class="form-control" id="diet" placeholder="Dietary Restrictions">{%if volunteer.dietRestriction%}{{volunteer.dietRestriction}}{%endif%}</textarea>
</div>
</div>
<br>
<button type="button" class="saveDiet btn btn-primary" data-user="{{volunteer.username}}">Save</button>
Expand Down Expand Up @@ -624,4 +630,4 @@ <h6 align="left" class="d-inline-flex" id="unbanVolunteerEndDate">End Date: &nbs
</div>

<!-- ################# Ban or Unban Modal ################ -->
{% endblock %}
{% endblock %}