Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added portal/static/portal/among_us_drip.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions portal/templates/portal/meetings/attendance/among_us.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{% extends "portal/base.html" %}
{% load static %}

{% block content %}
<section class="section">
<div class="container has-text-centered">
<h1 class="title">AMONG US???</h1>
<p class="subtitle">You tried to submit a very sus attendance code.</p>

<figure class="image is-256x256" style="margin: 0 auto;">
<img src="{% static 'portal/among_us_drip.png' %}" alt="Among Us drip">
</figure>

<p style="margin-top: 1.5rem;">
This code will never count for attendance. Nice try.
</p>

<a class="button is-link" href="{% url 'submit_attendance' %}">
Back to Attendance
</a>
</div>
</section>
{% endblock %}
34 changes: 23 additions & 11 deletions portal/templates/portal/meetings/attendance/submit.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,29 @@
{% load crispy_forms_tags %}

{% block content %}
<section class="section">
<div class="container">
<h1 class="title">Submit Attendance</h1>
{% if is_among_us %}
<section class="section"
style="background: radial-gradient(circle at top left, #ff3860, #111); min-height: 100vh;">
<div class="container">
<div class="box has-text-centered"
style="box-shadow: 0 0 40px rgba(255,56,96,0.7); transform: rotate(-1deg);">
<h1 class="title has-text-danger">AMONG US?</h1>
<p class="subtitle">
You found a sus code. This will not count for attendance.
</p>
<p>Try entering a real attendance code below.</p>

{% crispy form %}
</div>
</div>
</section>
{% else %}
<section class="section">
<div class="container">
<h1 class="title">Submit Attendance</h1>
{% crispy form %}
<!-- <form method="post">
{% csrf_token %}

</div>
</section>
{% endif %}
{% endblock %}

<button class="button" type="submit">Submit</button>
</form> -->
</div>
</section>
{% endblock %}
10 changes: 10 additions & 0 deletions portal/views/meetings.py
Original file line number Diff line number Diff line change
Expand Up @@ -246,6 +246,16 @@ def form_valid(self, form: SubmitAttendanceForm):
code = form.cleaned_data["code"]
user = self.request.user

# Among Us Mode
if code.upper() == "AMONG US":
# Re-render page to special "Among Us" theme
return render(
self.request,
"portal/meetings/attendance/among_us.html",
{"code": code},
)


# Search for attendance code
try:
meeting_attendance_code = MeetingAttendanceCode.objects.select_related(
Expand Down
37 changes: 31 additions & 6 deletions rcos_io/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,14 @@
}
}

if os.environ.get("ENV") == "development":
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": BASE_DIR / "db.sqlite3",
}
}

AUTH_USER_MODEL = "portal.User"

AUTHENTICATION_BACKENDS = (
Expand Down Expand Up @@ -317,12 +325,29 @@
# }
# }
# else:
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": os.environ["REDIS_URL"],
#CACHES = {
# "default": {
# "BACKEND": "django.core.cache.backends.redis.RedisCache",
# "LOCATION": os.environ["REDIS_URL"],
# }
#}

if os.environ.get("ENV") == "development":
# Simple in-memory cache for local dev
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.locmem.LocMemCache",
"LOCATION": "unique-dev-cache",
}
}
}
else:
CACHES = {
"default": {
"BACKEND": "django.core.cache.backends.redis.RedisCache",
"LOCATION": os.environ["REDIS_URL"],
}
}


LOGGING = {
"version": 1,
Expand Down Expand Up @@ -350,4 +375,4 @@

DEBUG_TOOLBAR_CONFIG = {
'RESULTS_CACHE_SIZE': 100
}
}