Commit a30558c9 authored by Daniel W Bond's avatar Daniel W Bond

room template (sans links)

parent 321e0bee
......@@ -5,16 +5,38 @@
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-12 text-center">
<h1><strong>GMU</strong>ROOMLIST</h1>
<p class="lead"><strong>{{ room.floor.building.name }}{{ room.number }}</strong></p>
<h1><strong>SRCT</strong>ROOMLIST</h1>
<p class="lead"><strong>{{ room.floor.building.name }} {{ room.number }}</strong></p>
</div>
</div>
</div>
{% load gravatar %}
<div class="row">
{% for student in students %}
{{ student }}
<div class="col-sm-3 text-center">
<img class="img-circle img-responsive center center-block" src="{% gravatar_url student.user.email 100 %}" alt="{{ student.user.first_name }} Gravatar picture">
<h4><a href="#">{{ student.user.first_name }} {{ student.user.last_name }}</a></h4>
<h5><em>{{ student.major.name }}</em></h5>
</div>
{% endfor %}
</div>
<br />
<div class="row">
<div class="col-md-8 col-md-offset-2">
<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 one of your roommates? Tell them about SRCT Roomlist!
{% endif %}
</em></strong></div>
</div>
</div>
{% endblock %}
......@@ -87,14 +87,14 @@ class DetailRoom(LoginRequiredMixin, DetailView):
# if self.request.user is on the floor
def onFloor():
floor_status = False
if requesting_student.get_floor == self.get_object().floor:
if requesting_student.get_floor() == self.get_object().floor:
floor_status = True
return floor_status
# if self.request.user is in the building
def inBuilding():
building_status = False
if requesting_student.get_building == self.get_object().floor.building:
if requesting_student.get_building() == self.get_object().floor.building:
building_status = True
return building_status
......@@ -106,6 +106,9 @@ class DetailRoom(LoginRequiredMixin, DetailView):
students = Student.objects.filter(room=self.get_object()).students()
context['students'] = students
context['notOnFloor'] = not onFloor()
context['notInBuilding'] = not inBuilding()
return context
login_url = '/'
......
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