Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
a30558c9
Commit
a30558c9
authored
Feb 21, 2015
by
Daniel W Bond
Browse files
room template (sans links)
parent
321e0bee
Changes
2
Hide whitespace changes
Inline
Side-by-side
roomlist/housing/templates/detail_room.html
View file @
a30558c9
...
@@ -5,16 +5,38 @@
...
@@ -5,16 +5,38 @@
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"page-header"
id=
"banner"
>
<div
class=
"row"
>
<div
class=
"row"
>
<div
class=
"col-lg-12 text-center"
>
<div
class=
"col-lg-12 text-center"
>
<h1><strong>
GMU
</strong>
ROOMLIST
</h1>
<h1><strong>
SRCT
</strong>
ROOMLIST
</h1>
<p
class=
"lead"
><strong>
{{ room.floor.building.name }}{{ room.number }}
</strong></p>
<p
class=
"lead"
><strong>
{{ room.floor.building.name }}
{{ room.number }}
</strong></p>
</div>
</div>
</div>
</div>
</div>
</div>
{% load gravatar %}
<div
class=
"row"
>
<div
class=
"row"
>
{% for student in students %}
{% 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 %}
{% endfor %}
</div>
</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 %}
{% endblock %}
roomlist/housing/views.py
View file @
a30558c9
...
@@ -87,14 +87,14 @@ class DetailRoom(LoginRequiredMixin, DetailView):
...
@@ -87,14 +87,14 @@ class DetailRoom(LoginRequiredMixin, DetailView):
# if self.request.user is on the floor
# if self.request.user is on the floor
def
onFloor
():
def
onFloor
():
floor_status
=
False
floor_status
=
False
if
requesting_student
.
get_floor
==
self
.
get_object
().
floor
:
if
requesting_student
.
get_floor
()
==
self
.
get_object
().
floor
:
floor_status
=
True
floor_status
=
True
return
floor_status
return
floor_status
# 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
().
floor
.
building
:
if
requesting_student
.
get_building
()
==
self
.
get_object
().
floor
.
building
:
building_status
=
True
building_status
=
True
return
building_status
return
building_status
...
@@ -106,6 +106,9 @@ class DetailRoom(LoginRequiredMixin, DetailView):
...
@@ -106,6 +106,9 @@ class DetailRoom(LoginRequiredMixin, DetailView):
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
students
()
students
=
Student
.
objects
.
filter
(
room
=
self
.
get_object
()).
students
()
context
[
'students'
]
=
students
context
[
'students'
]
=
students
context
[
'notOnFloor'
]
=
not
onFloor
()
context
[
'notInBuilding'
]
=
not
inBuilding
()
return
context
return
context
login_url
=
'/'
login_url
=
'/'
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment