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
97e195f2
Commit
97e195f2
authored
Feb 27, 2016
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
now the only remaining page needing block filters is the majors page
parent
bfa76a06
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
3 deletions
+14
-3
roomlist/accounts/templates/search/search.html
roomlist/accounts/templates/search/search.html
+2
-0
roomlist/accounts/views.py
roomlist/accounts/views.py
+4
-0
roomlist/settings/views.py
roomlist/settings/views.py
+8
-3
No files found.
roomlist/accounts/templates/search/search.html
View file @
97e195f2
...
...
@@ -40,6 +40,7 @@ SRCT Roomlist • Search Students
{% endif %}
{% for result in page.object_list %}
{% if not result.object.user.student in request.user.student.blocked_kids.all %}
<tr>
<td>
<h4>
{{ result.object.user.username }}
</h4>
...
...
@@ -55,6 +56,7 @@ SRCT Roomlist • Search Students
{% endif %}
</td>
</tr>
{% endif %}
{% empty %}
<h3
class=
"text-center"
>
No results found.
</h3>
{% endfor %}
...
...
roomlist/accounts/views.py
View file @
97e195f2
...
...
@@ -418,6 +418,10 @@ class CreateConfirmation(LoginRequiredMixin, CreateView):
if
flags
>=
1
:
return
HttpResponseForbidden
()
# you can't see the page if the person has banned you
if
confirmer
in
student
.
blocked_kids
.
all
():
raise
Http404
return
super
(
CreateConfirmation
,
self
).
get
(
request
,
*
args
,
**
kwargs
)
...
...
roomlist/settings/views.py
View file @
97e195f2
...
...
@@ -7,6 +7,8 @@ from django.views.generic import (View, DetailView, TemplateView)
from
braces.views
import
LoginRequiredMixin
from
cas.views
import
login
as
cas_login
from
accounts.models
import
Student
# imports from your apps
from
housing.views
import
shadowbanning
class
HomePageView
(
View
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
@@ -25,10 +27,13 @@ class LandingPage(LoginRequiredMixin, TemplateView):
context
[
'me'
]
=
me
# Create Dictionaries to store Students that meet criteria
context
[
"roomies"
]
=
Student
.
objects
.
filter
(
room
=
me
.
room
).
exclude
(
user__username
=
me
)
context
[
"floories"
]
=
Student
.
objects
.
filter
(
room__floor
=
me
.
get_floor
()).
exclude
(
user__username
=
me
).
exclude
(
room
=
me
.
room
).
order_by
(
'room'
)
context
[
"majormates"
]
=
Student
.
objects
.
filter
(
major
=
me
.
major
).
exclude
(
user__username
=
me
).
order_by
(
'?'
)[:
8
]
roomies
=
Student
.
objects
.
filter
(
room
=
me
.
room
).
exclude
(
user__username
=
me
)
floories
=
Student
.
objects
.
filter
(
room__floor
=
me
.
get_floor
()).
exclude
(
user__username
=
me
).
exclude
(
room
=
me
.
room
).
order_by
(
'room'
)
majormates
=
Student
.
objects
.
filter
(
major
=
me
.
major
).
exclude
(
user__username
=
me
).
order_by
(
'?'
)[:
8
]
context
[
"roomies"
]
=
shadowbanning
(
me
,
roomies
)
context
[
"floories"
]
=
shadowbanning
(
me
,
floories
)
context
[
"majormates"
]
=
shadowbanning
(
me
,
majormates
)
# Hack to Correctly Display Building plus Floor
#floor = str(me.get_floor())
#if floor[len(floor)-1:len(floor)] == "1":
...
...
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