Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
23
Issues
23
List
Boards
Labels
Service Desk
Milestones
Merge Requests
2
Merge Requests
2
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
SRCT
roomlist
Commits
a0cccfb0
Commit
a0cccfb0
authored
May 25, 2017
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ras and rds will always be listed first on floor pages
parent
857b380d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
2 deletions
+9
-2
roomlist/housing/views.py
roomlist/housing/views.py
+9
-2
No files found.
roomlist/housing/views.py
View file @
a0cccfb0
...
...
@@ -79,10 +79,17 @@ class DetailFloor(LoginRequiredMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailFloor
,
self
).
get_context_data
(
**
kwargs
)
requesting_student
=
Student
.
objects
.
get
(
user
=
self
.
request
.
user
)
requesting_student
=
self
.
request
.
user
.
student
students
=
Student
.
objects
.
visible
(
requesting_student
,
self
.
get_object
())
# list RAs first
staff
=
[
student
for
student
in
students
if
student
.
is_staff
()]
for
s
in
staff
:
students
.
insert
(
0
,
students
.
pop
(
students
.
index
(
s
)))
context
[
'students'
]
=
shadowbanning
(
requesting_student
,
students
)
# boolean values; helps cut down on if/else block complexity on the template
context
[
'notOnFloor'
]
=
not
(
requesting_student
in
self
.
get_object
())
...
...
@@ -113,7 +120,7 @@ class DetailRoom(LoginRequiredMixin, DetailView):
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailRoom
,
self
).
get_context_data
(
**
kwargs
)
requesting_student
=
Student
.
objects
.
get
(
user
=
self
.
request
.
user
)
requesting_student
=
self
.
request
.
user
.
student
students
=
Student
.
objects
.
visible
(
requesting_student
,
self
.
get_object
())
...
...
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