diff --git a/files/helpers/discord.py b/files/helpers/discord.py index d0993a752..caa67bc4a 100644 --- a/files/helpers/discord.py +++ b/files/helpers/discord.py @@ -33,6 +33,13 @@ def add_role(user, role_name): headers = {"Authorization": f"Bot {BOT_TOKEN}"} requests.put(url, headers=headers, timeout=5) +@discord_wrap +def remove_role(user, role_name): + role_id = ROLES[role_name] + url = f"https://discordapp.com/api/guilds/{SERVER_ID}/members/{user.discord_id}/roles/{role_id}" + headers = {"Authorization": f"Bot {BOT_TOKEN}"} + requests.delete(url, headers=headers, timeout=5) + @discord_wrap def remove_user(user): url=f"https://discordapp.com/api/guilds/{SERVER_ID}/members/{user.discord_id}" diff --git a/files/routes/awards.py b/files/routes/awards.py index de8dc0b1e..fa3c59ec6 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -345,6 +345,7 @@ def award_post(pid, v): author.patron = 1 author.patron_utc += int(time.time()) + 2629746 author.procoins += 2500 + if author.discord_id: add_role(author, "1") if not v.has_badge(103): badge = Badge(user_id=v.id, badge_id=103) g.db.add(badge) @@ -575,6 +576,7 @@ def award_comment(cid, v): author.patron = 1 author.patron_utc += int(time.time()) + 2629746 author.procoins += 2500 + if author.discord_id: add_role(author, "1") if not v.has_badge(103): badge = Badge(user_id=v.id, badge_id=103) g.db.add(badge) diff --git a/files/routes/front.py b/files/routes/front.py index 5ef5d34bf..4c00ee8ea 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -171,10 +171,10 @@ def front_all(v, sub=None, subdomain=None): if sort == 'bump': t='all' - try: gt=int(request.values.get("utc_greater_than", 0)) + try: gt=int(request.values.get("after", 0)) except: gt=0 - try: lt=int(request.values.get("utc_less_than", 0)) + try: lt=int(request.values.get("before", 0)) except: lt=0 if v: subs = v.subs @@ -204,6 +204,7 @@ def front_all(v, sub=None, subdomain=None): v.patron = 0 v.patron_utc = 0 send_repeatable_notification(v.id, "Your paypig status has expired!") + if v.discord_id: remove_role(v, "1") g.db.add(v) g.db.commit() @@ -491,10 +492,10 @@ def all_comments(v): sort=request.values.get("sort", "new") t=request.values.get("t", defaulttimefilter) - try: gt=int(request.values.get("utc_greater_than", 0)) + try: gt=int(request.values.get("after", 0)) except: gt=0 - try: lt=int(request.values.get("utc_less_than", 0)) + try: lt=int(request.values.get("before", 0)) except: lt=0 idlist = comment_idlist(v=v, diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 0adb85eb4..e2ec65556 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 a3b8580b0..a1dda9ae0 100644 --- a/files/templates/chat.html +++ b/files/templates/chat.html @@ -14,7 +14,7 @@ Chat - + {% if v.css %} @@ -66,7 +66,7 @@ margin-top: 0.5rem; } #chat-window { - max-height: calc(100vh - 190px); + max-height: calc(100vh - 255px); } } @@ -192,6 +192,7 @@ {% include "emoji_modal.html" %} {% include "expanded_image_modal.html" %} +{% include "mobile_navigation_bar.html" %} diff --git a/files/templates/comments.html b/files/templates/comments.html index 5dc72f8f6..7eebbac05 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -855,7 +855,7 @@ {% include "expanded_image_modal.html" %} - + {% if v %} - + {% if v.agendaposter %} - + {% endif %} diff --git a/files/templates/header.html b/files/templates/header.html index a81b46109..360dc472b 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -83,6 +83,9 @@