Skip to content

Commit

Permalink
add mafiasi purple; rename specialDay to specialFeature
Browse files Browse the repository at this point in the history
  • Loading branch information
kritzl committed Apr 1, 2024
2 parents 26bf8ea + 6654ded commit 35e2f27
Show file tree
Hide file tree
Showing 10 changed files with 311 additions and 48 deletions.
44 changes: 35 additions & 9 deletions locale/de_DE/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-01 01:46+0200\n"
"PO-Revision-Date: 2024-01-12 16:56+0100\n"
"Last-Translator: Timon Engelke <timon.engelke@uni-hamburg.de>\n"
"POT-Creation-Date: 2024-04-01 02:11+0200\n"
"PO-Revision-Date: 2024-01-18 22:42+0100\n"
"Last-Translator: Markus Neblung <markus.neblung@uni-hamburg.de>\n"
"Language-Team: \n"
"Language: de_DE\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Poedit 3.4.1\n"
"X-Generator: Poedit 3.0.1\n"

#: mafiasi/base/middleware.py:18
msgid ""
Expand Down Expand Up @@ -169,29 +169,55 @@ msgstr "Mit dem BitPoll kannst du einfach gemeinsame Termine finden."
msgid "Dashboard"
msgstr "Dashboard"

#: mafiasi/dashboard/templates/dashboard/index.html:13
#: mafiasi/dashboard/templates/dashboard/index.html:16
msgid "Services"
msgstr "Dienste"

#: mafiasi/dashboard/templates/dashboard/index.html:30
#: mafiasi/dashboard/templates/dashboard/index.html:33
msgid "Rearrange item"
msgstr "Dienst umordnen"

#: mafiasi/dashboard/templates/dashboard/index.html:38
#: mafiasi/dashboard/templates/dashboard/index.html:41
msgid "News and more"
msgstr "Aktuelles und mehr"

#: mafiasi/dashboard/templates/dashboard/index.html:54
#: mafiasi/dashboard/templates/dashboard/index.html:57
msgid "Wiki search"
msgstr "Wiki-Suche"

#: mafiasi/dashboard/templates/dashboard/index.html:61
#: mafiasi/dashboard/templates/dashboard/index.html:64
#: mafiasi/gprot/templates/gprot/menu.html:4
#: mafiasi/pks/templates/pks/menu.html:4
#: mafiasi/pks/templates/pks/search.html:5
msgid "Search"
msgstr "Suche"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:8
msgid ""
"From today we offer <mark>Mafiasi Purple</mark> for ✨ only 42€ per month ✨ "
"to finance the Server-AG! You can support us by subscribing to <mark>Mafiasi "
"Purple</mark>."
msgstr ""
"Ab heute bieten wir <mark>Mafiasi Purple</mark> für ✨ nur 42€ im Monat ✨ "
"zur Finanzierung der Server-AG an! Du kannst uns unterstützen, indem du "
"<mark>Mafiasi Purple</mark> abbonierst."

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:9
msgid ""
"For people who want to continue using Mafiasi for free, we are offering "
"Mafiasi with advertising from today. The choice is yours!"
msgstr ""
"Für Leute, die Mafiasi weiterhin kostenlos nutzen wollen, bieten wir Mafiasi "
"ab heute mit Werbung an. Du hast die Wahl!"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:12
msgid "Continue with ads"
msgstr "Weiter mit Werbung"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:15
msgid "Book Mafiasi Purple"
msgstr "Mafiasi Purple buchen"

#: mafiasi/discourse/apps.py:11
msgid "Discourse"
msgstr "Discourse"
Expand Down
37 changes: 29 additions & 8 deletions locale/en_US/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-01 01:46+0200\n"
"PO-Revision-Date: 2024-01-12 17:06+0100\n"
"Last-Translator: Timon Engelke <timon.engelke@uni-hamburg.de>\n"
"POT-Creation-Date: 2024-04-01 02:11+0200\n"
"PO-Revision-Date: 2024-01-18 22:42+0100\n"
"Last-Translator: Markus Neblung <markus.neblung@uni-hamburg.de>\n"
"Language-Team: \n"
"Language: en\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -155,29 +155,50 @@ msgstr ""
msgid "Dashboard"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/index.html:13
#: mafiasi/dashboard/templates/dashboard/index.html:16
msgid "Services"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/index.html:30
#: mafiasi/dashboard/templates/dashboard/index.html:33
msgid "Rearrange item"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/index.html:38
#: mafiasi/dashboard/templates/dashboard/index.html:41
msgid "News and more"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/index.html:54
#: mafiasi/dashboard/templates/dashboard/index.html:57
msgid "Wiki search"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/index.html:61
#: mafiasi/dashboard/templates/dashboard/index.html:64
#: mafiasi/gprot/templates/gprot/menu.html:4
#: mafiasi/pks/templates/pks/menu.html:4
#: mafiasi/pks/templates/pks/search.html:5
msgid "Search"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:8
msgid ""
"From today we offer <mark>Mafiasi Purple</mark> for ✨ only 42€ per month ✨ "
"to finance the Server-AG! You can support us by subscribing to <mark>Mafiasi "
"Purple</mark>."
msgstr ""

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:9
msgid ""
"For people who want to continue using Mafiasi for free, we are offering "
"Mafiasi with advertising from today. The choice is yours!"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:12
msgid "Continue with ads"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:15
msgid "Book Mafiasi Purple"
msgstr ""

#: mafiasi/discourse/apps.py:11
msgid "Discourse"
msgstr ""
Expand Down
35 changes: 29 additions & 6 deletions locale/en_Uwu/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-01 01:46+0200\n"
"POT-Creation-Date: 2024-04-01 02:11+0200\n"
"PO-Revision-Date: 2024-01-09 22:14+0000\n"
"Last-Translator: kritzl <kritzl@kritzl.dev>\n"
"Language-Team: \n"
Expand Down Expand Up @@ -169,29 +169,52 @@ msgstr "Pawl is helps u find dates with frens :*"
msgid "Dashboard"
msgstr "Homi UwU"

#: mafiasi/dashboard/templates/dashboard/index.html:13
#: mafiasi/dashboard/templates/dashboard/index.html:16
msgid "Services"
msgstr "Behold: my stuff! (●'◡'●)"

#: mafiasi/dashboard/templates/dashboard/index.html:30
#: mafiasi/dashboard/templates/dashboard/index.html:33
msgid "Rearrange item"
msgstr "Move thingy"

#: mafiasi/dashboard/templates/dashboard/index.html:38
#: mafiasi/dashboard/templates/dashboard/index.html:41
msgid "News and more"
msgstr "Meows and snacks"

#: mafiasi/dashboard/templates/dashboard/index.html:54
#: mafiasi/dashboard/templates/dashboard/index.html:57
msgid "Wiki search"
msgstr "Look up knowings"

#: mafiasi/dashboard/templates/dashboard/index.html:61
#: mafiasi/dashboard/templates/dashboard/index.html:64
#: mafiasi/gprot/templates/gprot/menu.html:4
#: mafiasi/pks/templates/pks/menu.html:4
#: mafiasi/pks/templates/pks/search.html:5
msgid "Search"
msgstr "Looksies"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:8
msgid ""
"From today we offer <mark>Mafiasi Purple</mark> for ✨ only 42€ per month ✨ "
"to finance the Server-AG! You can support us by subscribing to <mark>Mafiasi "
"Purple</mark>."
msgstr ""

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:9
msgid ""
"For people who want to continue using Mafiasi for free, we are offering "
"Mafiasi with advertising from today. The choice is yours!"
msgstr ""

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:12
#, fuzzy
#| msgid "Continue"
msgid "Continue with ads"
msgstr "Continue"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:15
msgid "Book Mafiasi Purple"
msgstr ""

#: mafiasi/discourse/apps.py:11
msgid "Discourse"
msgstr "Talks with frens 1"
Expand Down
43 changes: 35 additions & 8 deletions locale/fr_FR/LC_MESSAGES/django.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ msgid ""
msgstr ""
"Project-Id-Version: Mafiasi\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2024-04-01 01:46+0200\n"
"PO-Revision-Date: 2024-01-15 16:39+0100\n"
"Last-Translator: Timon Engelke <timon.engelke@uni-hamburg.de>\n"
"POT-Creation-Date: 2024-04-01 02:11+0200\n"
"PO-Revision-Date: 2024-01-18 22:41+0100\n"
"Last-Translator: Markus Neblung <markus.neblung@uni-hamburg.de>\n"
"Language-Team: \n"
"Language: fr_FR\n"
"MIME-Version: 1.0\n"
Expand Down Expand Up @@ -175,29 +175,56 @@ msgstr ""
msgid "Dashboard"
msgstr "Dashboard"

#: mafiasi/dashboard/templates/dashboard/index.html:13
#: mafiasi/dashboard/templates/dashboard/index.html:16
msgid "Services"
msgstr "Services"

#: mafiasi/dashboard/templates/dashboard/index.html:30
#: mafiasi/dashboard/templates/dashboard/index.html:33
msgid "Rearrange item"
msgstr "Réorganiser"

#: mafiasi/dashboard/templates/dashboard/index.html:38
#: mafiasi/dashboard/templates/dashboard/index.html:41
msgid "News and more"
msgstr "Les nouvelles et plus"

#: mafiasi/dashboard/templates/dashboard/index.html:54
#: mafiasi/dashboard/templates/dashboard/index.html:57
msgid "Wiki search"
msgstr "Recherche Wiki"

#: mafiasi/dashboard/templates/dashboard/index.html:61
#: mafiasi/dashboard/templates/dashboard/index.html:64
#: mafiasi/gprot/templates/gprot/menu.html:4
#: mafiasi/pks/templates/pks/menu.html:4
#: mafiasi/pks/templates/pks/search.html:5
msgid "Search"
msgstr "Recherche"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:8
msgid ""
"From today we offer <mark>Mafiasi Purple</mark> for ✨ only 42€ per month ✨ "
"to finance the Server-AG! You can support us by subscribing to <mark>Mafiasi "
"Purple</mark>."
msgstr ""
"A partir d'aujourd'hui, nous proposons <mark>Mafiasi Purple</mark> pour ✨ "
"seulement 42€ par mois ✨ pour financer le Server-AG ! Tu peux nous soutenir "
"en t'abonnant à <mark>Mafiasi Purple</mark>."

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:9
msgid ""
"For people who want to continue using Mafiasi for free, we are offering "
"Mafiasi with advertising from today. The choice is yours!"
msgstr ""
"Pour les personnes qui souhaitent continuer à utiliser Mafiasi gratuitement, "
"nous proposons Mafiasi avec de la publicité à partir d'aujourd'hui. A toi de "
"choisir !"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:12
msgid "Continue with ads"
msgstr "Continuer avec les annonces"

#: mafiasi/dashboard/templates/dashboard/mafiasi_purple.html:15
msgid "Book Mafiasi Purple"
msgstr "Livre Mafiasi Purple"

#: mafiasi/discourse/apps.py:11
msgid "Discourse"
msgstr "Discourse"
Expand Down
18 changes: 11 additions & 7 deletions mafiasi/base/special_day_middleware.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,27 +10,31 @@ def __init__(self, get_response):

def __call__(self, request):
request.session["specialDay"] = False
request.session["specialDayClasses"] = ""
request.session["specialFeature"] = False
request.session["specialFeatureClasses"] = ""

# get date in current timezone
n = localdate(now(), get_current_timezone())

# check if user disabled special day surprises via cookie
if not request.COOKIES.get("disable-specialday", False):
if not request.COOKIES.get("disable-special", False):
# first of april (april fools)
if n.day == 1 and n.month == 4:
request.session["specialDay"] = "aprilfools"
option = random.randint(0, 1)
request.session["specialDay"] = "April Fools"
option = random.randint(0, 2)
if option == 0:
request.session["specialDayClasses"] += " first-of-april"
request.session["specialFeature"] = "upsideDown"
request.session["specialFeatureClasses"] += " first-of-april"
elif option == 1:
request.session["specialFeature"] = "uwu"
translation.activate("en-uwu")
request.LANGUAGE_CODE = translation.get_language()
elif option == 2:
request.session["specialFeature"] = "mafiasiPurple"

# winter season
if n.month == 12 and n.day >= 10:
request.session["specialDay"] = "winter"
request.session["specialDayClasses"] += " snowing"
request.session["specialFeature"] = "winter"

# call view
response = self.get_response(request)
Expand Down
2 changes: 1 addition & 1 deletion mafiasi/base/static/css/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,6 @@ body {
cursor: pointer;
}

#specialday-off {
#specialfeature-off {
margin-top: 14px;
}
6 changes: 3 additions & 3 deletions mafiasi/base/static/js/misc.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@ function toggleTheme() {
document.documentElement.dataset.theme = theme
}

function disableSpecialDaySurprise() {
function disableSpecialFeature() {
const tomorrow = new Date()
tomorrow.setDate(tomorrow.getDate() + 1);
tomorrow.setHours(0, 0, 0);
document.cookie = `disable-specialday=True; path=/; expires=${tomorrow.toUTCString()}; Secure`;
document.cookie = `disable-special=True; path=/; expires=${tomorrow.toUTCString()}; Secure`;
window.location.reload()
}

document.querySelector('#specialday-off').addEventListener('click', disableSpecialDaySurprise)
document.querySelector('#specialfeature-off').addEventListener('click', disableSpecialFeature)
8 changes: 4 additions & 4 deletions mafiasi/base/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<script>
if (localStorage.mafiasi_theme) document.documentElement.dataset.theme = localStorage.mafiasi_theme;
</script>
{% if request.session.specialDay == 'winter' %}
{% if request.session.specialFeature == 'winter' %}
<link rel="stylesheet" href="{% static 'css/snow.css' %}" />
{% endif %}
</head>
Expand All @@ -37,8 +37,8 @@
{% endif %}
<div class="container">
<a href="/" class="navbar-brand">{% value_from_settings PROJECT_BANNER %}</a>
{% if request.session.specialDay %}
<a class="btn btn-danger btn-xs" href="#" id="specialday-off">
{% if request.session.specialFeature %}
<a class="btn btn-danger btn-xs" href="#" id="specialfeature-off">
<span class="glyphicon glyphicon-gift"></span> {% trans "Disable surprise" %}
</a>
{% endif %}
Expand Down Expand Up @@ -119,7 +119,7 @@ <h2>{% block ptitle %}{% endblock %}</h2>
</div>
</div>

{% if request.session.specialDay == 'winter' %}
{% if request.session.specialFeature == 'winter' %}
<canvas id="snow-canvas"></canvas>
<script src="{% static 'js/snow.js' %}" type="module"></script>
{% endif %}
Expand Down
Loading

0 comments on commit 35e2f27

Please sign in to comment.