From 5871c6106e25d8a9114291d47caff1c0f9b1a6dc Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 22 Feb 2022 13:43:38 +0200 Subject: [PATCH] vc --- files/routes/admin.py | 18 +++++++++--------- files/routes/awards.py | 2 +- files/routes/oauth.py | 6 +++--- files/routes/subs.py | 12 ++++++------ files/templates/submit.html | 7 +++++-- files/templates/userpage.html | 26 +++++++++++++------------- files/templates/userpage_comments.html | 2 +- files/templates/userpage_private.html | 2 +- 8 files changed, 39 insertions(+), 36 deletions(-) diff --git a/files/routes/admin.py b/files/routes/admin.py index df826c72e..482ac6334 100644 --- a/files/routes/admin.py +++ b/files/routes/admin.py @@ -178,14 +178,14 @@ def revert_actions(v, username): user.is_banned = 0 user.unban_utc = 0 user.ban_evade = 0 - send_repeatable_notification(user.id, "Your account has been unbanned!") + send_repeatable_notification(user.id, f"@{v.username} has unbanned you!") g.db.add(user) for u in user.alts: u.shadowbanned = None u.is_banned = 0 u.unban_utc = 0 u.ban_evade = 0 - send_repeatable_notification(u.id, "Your account has been unbanned!") + send_repeatable_notification(u.id, f"@{v.username} has unbanned you!") g.db.add(u) g.db.commit() @@ -307,17 +307,17 @@ def monthly(v): elif u.patron == 6: procoins = 125000 u.procoins += procoins g.db.add(u) - send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") + send_repeatable_notification(u.id, f"@{v.username} has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") elif u.patron == 5: procoins = 50000 u.procoins += procoins g.db.add(u) - send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") + send_repeatable_notification(u.id, f"@{v.username} has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") elif u.patron == 1 and u.admin_level > 0: procoins = 2500 u.procoins += procoins g.db.add(u) - send_repeatable_notification(u.id, f"You were given {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") + send_repeatable_notification(u.id, f"@{v.username} has given you {procoins} Marseybux for the month of {month}! You can use them to buy awards in the [shop](/shop).") else: print(u.username) if request.host == 'pcmemes.net': @@ -821,7 +821,7 @@ def agendaposter(user_id, v): send_notification(user.id, f"@AutoJanny has given you the following profile badge:\n\n![]({badge.path})\n\n{badge.name}") - send_repeatable_notification(user.id, f"You have been marked by an admin as an agendaposter ({note}).") + send_repeatable_notification(user.id, f"@{v.username} has marked you as an agendaposter ({note}).") g.db.commit() @@ -852,7 +852,7 @@ def unagendaposter(user_id, v): badge = user.has_badge(28) if badge: g.db.delete(badge) - send_repeatable_notification(user.id, "You have been unmarked by an admin as an agendaposter.") + send_repeatable_notification(user.id, f"@{v.username} has unmarked you as an agendaposter.") g.db.commit() return {"message": "Chud theme disabled!"} @@ -1096,7 +1096,7 @@ def unban_user(user_id, v): user.unban_utc = 0 user.ban_evade = 0 user.ban_reason = None - send_repeatable_notification(user.id, "Your account has been unbanned!") + send_repeatable_notification(user.id, f"@{v.username} has unbanned you!") g.db.add(user) for x in user.alts: @@ -1104,7 +1104,7 @@ def unban_user(user_id, v): x.unban_utc = 0 x.ban_evade = 0 x.ban_reason = None - send_repeatable_notification(x.id, "Your account has been unbanned!") + send_repeatable_notification(x.id, f"@{v.username} has unbanned you!") g.db.add(x) ma=ModAction( diff --git a/files/routes/awards.py b/files/routes/awards.py index e611b0680..0f2b8ede1 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -691,7 +691,7 @@ def admin_userawards_post(v): g.db.add(award) if v.id != u.id: - text = "You were given the following awards:\n\n" + text = f"@{v.username} has given the following awards:\n\n" for key, value in notify_awards.items(): text += f" - **{value}** {AWARDS[key]['title']} {'Awards' if value != 1 else 'Award'}\n" send_repeatable_notification(u.id, text) diff --git a/files/routes/oauth.py b/files/routes/oauth.py index 488874740..388c392df 100644 --- a/files/routes/oauth.py +++ b/files/routes/oauth.py @@ -131,7 +131,7 @@ def admin_app_approve(v, aid): g.db.add(new_auth) - send_repeatable_notification(user.id, f"Your application `{app.app_name}` has been approved. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.") + send_repeatable_notification(user.id, f"@{v.username} has approved your application `{app.app_name}`. Here's your access token: `{access_token}`\nPlease check the guide [here](/api) if you don't know what to do next.") ma = ModAction( kind="approve_app", @@ -154,7 +154,7 @@ def admin_app_revoke(v, aid): if app: for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth) - send_repeatable_notification(app.author.id, f"Your application `{app.app_name}` has been revoked.") + send_repeatable_notification(app.author.id, f"@{v.username} has revoked your application `{app.app_name}`.") g.db.delete(app) @@ -180,7 +180,7 @@ def admin_app_reject(v, aid): if app: for auth in g.db.query(ClientAuth).filter_by(oauth_client=app.id).all(): g.db.delete(auth) - send_repeatable_notification(app.author.id, f"Your application `{app.app_name}` has been rejected.") + send_repeatable_notification(app.author.id, f"@{v.username} has rejected your application `{app.app_name}`.") g.db.delete(app) diff --git a/files/routes/subs.py b/files/routes/subs.py index c0737ee51..4bd3d9ad6 100644 --- a/files/routes/subs.py +++ b/files/routes/subs.py @@ -29,7 +29,7 @@ def exile_post(v, pid): exile = Exile(user_id=u.id, sub=sub) g.db.add(exile) - send_notification(u.id, f"You have been exiled from /s/{sub} for [{p.title}]({p.sl})") + send_notification(u.id, f"@{v.username} has exiled you from /s/{sub} for [{p.title}]({p.sl})") g.db.commit() @@ -55,7 +55,7 @@ def unexile_post(v, pid): exile = g.db.query(Exile).filter_by(user_id=u.id, sub=sub).one_or_none() g.db.delete(exile) - send_notification(u.id, f"Your exile from /s/{sub} has been revoked!") + send_notification(u.id, f"@{v.username} has revoked your exile from /s/{sub}") g.db.commit() @@ -82,7 +82,7 @@ def exile_comment(v, cid): exile = Exile(user_id=u.id, sub=sub) g.db.add(exile) - send_notification(u.id, f"You have been exiled from /s/{sub} for [{c.permalink}]({c.sl})") + send_notification(u.id, f"@{v.username} has exiled you from /s/{sub} for [{c.permalink}]({c.sl})") g.db.commit() @@ -109,7 +109,7 @@ def unexile_comment(v, cid): exile = g.db.query(Exile).filter_by(user_id=u.id, sub=sub).one_or_none() g.db.delete(exile) - send_notification(u.id, f"Your exile from /s/{sub} has been revoked!") + send_notification(u.id, f"@{v.username} has revoked your exile from /s/{sub}") g.db.commit() @@ -212,7 +212,7 @@ def add_mod(v, sub): mod = Mod(user_id=user.id, sub=sub) g.db.add(mod) - send_repeatable_notification(user.id, f"You have been added as a mod to /s/{sub}") + send_repeatable_notification(user.id, f"@{v.username} has added you as a mod to /s/{sub}") g.db.commit() @@ -246,7 +246,7 @@ def remove_mod(v, sub): g.db.delete(mod) - send_repeatable_notification(user.id, f"You have been removed as a mod from /s/{sub}") + send_repeatable_notification(user.id, f"@{v.username} has removed you as a mod from /s/{sub}") g.db.commit() diff --git a/files/templates/submit.html b/files/templates/submit.html index b0069af67..381eb7d6f 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -226,8 +226,11 @@ document.getElementById('post-title').value = localStorage.getItem("post_title") document.getElementById('post-text').value = localStorage.getItem("post_text") document.getElementById('post-url').value = localStorage.getItem("post_url") - let sub = document.getElementById('sub') - if (sub) sub.value = localStorage.getItem("sub") + + {% if request.path == '/submit' %} + let sub = document.getElementById('sub') + if (sub) sub.value = localStorage.getItem("sub") + {% endif %} function checkForRequired() { diff --git a/files/templates/userpage.html b/files/templates/userpage.html index eb001b293..0b68ed7ae 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -170,11 +170,11 @@ {% if v and v.id != u.id %} {% if not u.fish %}Unfollow{% endif %} Follow - Message + Message Get them help - Gift coins - Gift Marseybux + Gift coins + Gift Marseybux {% if v.admin_level > 2 %} Make admin @@ -189,7 +189,7 @@ {% endif %} {% endif %} -
+

 							
@@ -207,13 +207,13 @@
 
 						
-
+
{{u.username}} will receive 0 coins
-
+
{{u.username}} will receive 0 marseybux
@@ -481,10 +481,10 @@ {% if v and v.id != u.id %} {% if not u.fish %}Unfollow{% endif %} Follow - Message + Message Get them help - Gift coins - Gift Marseybux + Gift coins + Gift Marseybux {% if v.admin_level > 2 %} Make admin @@ -499,7 +499,7 @@ {% endif %} {% endif %} - +

 						 
 						
@@ -517,13 +517,13 @@
 
 					
-
+
{{u.username}} will receive 0 coins
-
+
{{u.username}} will receive 0 marseybux
@@ -737,7 +737,7 @@ {% if v %}
{% if v.patron or u.patron or v.alts_patron or u.alts_patron %}0{% else %}0.03{% endif %}
- +
{{u.username}}
{% endif %} diff --git a/files/templates/userpage_comments.html b/files/templates/userpage_comments.html index 82c88fc8e..b57964f59 100644 --- a/files/templates/userpage_comments.html +++ b/files/templates/userpage_comments.html @@ -114,7 +114,7 @@ {% if v %}
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
- +
{{u.username}}
{% endif %} diff --git a/files/templates/userpage_private.html b/files/templates/userpage_private.html index 9b9f8b313..eaee86b32 100644 --- a/files/templates/userpage_private.html +++ b/files/templates/userpage_private.html @@ -48,7 +48,7 @@ {% if v %}
{% if v.patron or u.patron %}0{% else %}0.03{% endif %}
- +
{{u.username}}
{% endif %}