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
fe8426ce
Commit
fe8426ce
authored
Feb 21, 2015
by
Daniel W Bond
Browse files
alert changes depending on whether a student lives there
parent
7b7338b0
Changes
2
Hide whitespace changes
Inline
Side-by-side
roomlist/housing/templates/detail_floor.html
View file @
fe8426ce
...
...
@@ -31,7 +31,15 @@
<div
class=
"row"
>
<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>
...
...
roomlist/housing/views.py
View file @
fe8426ce
...
...
@@ -68,6 +68,8 @@ class DetailFloor(LoginRequiredMixin, DetailView):
floor_students
.
extend
(
Student
.
objects
.
filter
(
room
=
room
).
students
())
context
[
'students'
]
=
floor_students
context
[
'notOnFloor'
]
=
not
onFloor
()
context
[
'notInBuilding'
]
=
not
inBuilding
()
return
context
class
DetailRoom
(
LoginRequiredMixin
,
DetailView
):
...
...
@@ -92,7 +94,7 @@ class DetailRoom(LoginRequiredMixin, DetailView):
# if self.request.user is in the building
def
inBuilding
():
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
return
building_status
...
...
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