Commit fe8426ce authored by Daniel W Bond's avatar Daniel W Bond
Browse files

alert changes depending on whether a student lives there

parent 7b7338b0
...@@ -31,7 +31,15 @@ ...@@ -31,7 +31,15 @@
<div class="row"> <div class="row">
<div class="col-md-8 col-md-offset-2"> <div class="col-md-8 col-md-offset-2">
<div class="alert alert-info text-center"><strong><em>Depending on individual privacy settings, not all students may be displayed.</em></strong></div> <div class="alert alert-info text-center"><strong><em>
{% if notOnFloor %}
You don't live on this floor. Depending on individual privacy settings, not all students may be displayed.
{% elif notInBuilding %}
You don't live in this building. Depending on individual privacy settings, not all students may be displayed.
{% else %}
Don't see someone you know who lives here? Tell them to sign up for SRCT Roomlist!
{% endif %}
</em></strong></div>
</div> </div>
</div> </div>
......
...@@ -68,6 +68,8 @@ class DetailFloor(LoginRequiredMixin, DetailView): ...@@ -68,6 +68,8 @@ class DetailFloor(LoginRequiredMixin, DetailView):
floor_students.extend(Student.objects.filter(room=room).students()) floor_students.extend(Student.objects.filter(room=room).students())
context['students'] = floor_students context['students'] = floor_students
context['notOnFloor'] = not onFloor()
context['notInBuilding'] = not inBuilding()
return context return context
class DetailRoom(LoginRequiredMixin, DetailView): class DetailRoom(LoginRequiredMixin, DetailView):
...@@ -92,7 +94,7 @@ class DetailRoom(LoginRequiredMixin, DetailView): ...@@ -92,7 +94,7 @@ class DetailRoom(LoginRequiredMixin, DetailView):
# if self.request.user is in the building # if self.request.user is in the building
def inBuilding(): def inBuilding():
building_status = False building_status = False
if requesting_student.get_building == self.get_object().get_building: if requesting_student.get_building == self.get_object().floor.building:
building_status = True building_status = True
return building_status return building_status
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment