From 77175051ac99da5156b80fd7dd305ae5b3f6003b Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Thu, 7 Apr 2022 01:50:32 +0200 Subject: [PATCH] gd --- files/helpers/const.py | 8 ++++++++ files/routes/awards.py | 12 ++++++++---- files/templates/authforms.html | 4 ++-- files/templates/chat.html | 2 +- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings2.html | 4 ++-- files/templates/sign_up.html | 2 +- files/templates/sign_up_failed_ref.html | 2 +- files/templates/submit.html | 4 ++-- 12 files changed, 31 insertions(+), 19 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index a107a62c4..291b4a58f 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -374,6 +374,14 @@ AWARDS = { "color": "text-blue", "price": 300 }, + "glowie": { + "kind": "glowie", + "title": "Glowie", + "description": "Indicates that the recipient can be seen when driving. Just run them over.", + "icon": "fas fa-user-secret", + "color": "text-green", + "price": 300 + }, "rehab": { "kind": "rehab", "title": "Rehab", diff --git a/files/routes/awards.py b/files/routes/awards.py index ea7b965c4..8e5134f51 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -41,9 +41,9 @@ def buy(v, award): AWARDS = deepcopy(AWARDS2) if award not in AWARDS: abort(400) - price = AWARDS[award]["price"] + og_price = AWARDS[award]["price"] - price = int(price * v.discount) + price = int(og_price * v.discount) if request.values.get("mb"): if v.procoins < price: return {"error": "Not enough marseybux."}, 400 @@ -115,10 +115,14 @@ def buy(v, award): send_notification(v.id, f"@AutoJanny has given you the following profile badge:\n\n![]({new_badge.path})\n\n{new_badge.name}") else: - award = AwardRelationship(user_id=v.id, kind=award) - g.db.add(award) + award_object = AwardRelationship(user_id=v.id, kind=award) + g.db.add(award_object) g.db.add(v) + + if CARP_ID and v.id != CARP_ID and og_price >= 10000: + send_repeatable_notification(CARP_ID, f"@{v.username} has bought a `{award}` award!") + g.db.commit() return {"message": "Award bought!"} diff --git a/files/templates/authforms.html b/files/templates/authforms.html index d6d4d2dc6..3d2ba3396 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,7 +15,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/chat.html b/files/templates/chat.html index dba56603b..edf2e88d3 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -14,7 +14,7 @@ Chat - + {% if v.css %} diff --git a/files/templates/default.html b/files/templates/default.html index be262fc12..377abbae3 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -7,7 +7,7 @@ {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 6b3ff9627..4a7bc03a6 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,7 +6,7 @@ {% block content %} {% if v %} - + {% if v.agendaposter %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 4d909acf6..70d0ffb8c 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -18,7 +18,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 2e12ec600..1e84c21a8 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -14,7 +14,7 @@ 2-Step Login - {{SITE_NAME}} - + diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 43be58fdf..a8debcdea 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -39,10 +39,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index d24d9574c..b6287052c 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}Sign up - {{SITE_NAME}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 6ae7716b0..15d33864e 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -32,7 +32,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{SITE_NAME}}{% else %}{{SITE_NAME}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 36dc1d1a2..b377902fb 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}