diff --git a/files/classes/mod_logs.py b/files/classes/mod_logs.py index 87bfda248..fb6cb6de6 100644 --- a/files/classes/mod_logs.py +++ b/files/classes/mod_logs.py @@ -110,7 +110,7 @@ class ModAction(Base): return f"{SITE_FULL}/log/{self.id}" ACTIONTYPES = { - 'agendaposter': { + 'agendaposter': { "str": 'set chud theme on {self.target_link}', "icon": 'fa-snooze', "color": 'bg-danger' diff --git a/files/helpers/const.py b/files/helpers/const.py index 038b2fc84..5a6fe4e81 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -439,13 +439,13 @@ AWARDS = { "price": 2500 }, "deflector": { - "kind": "deflector", - "title": "Deflector", - "description": "Causes most awards received for the next 10 hours to be deflected back at their giver.", - "icon": "fas fa-shield", - "color": "text-pink", - "price": 2750 - }, + "kind": "deflector", + "title": "Deflector", + "description": "Causes most awards received for the next 10 hours to be deflected back at their giver.", + "icon": "fas fa-shield", + "color": "text-pink", + "price": 2750 + }, "marsey": { "kind": "marsey", "title": "Marsey", diff --git a/files/helpers/patter.py b/files/helpers/patter.py index feb0afca6..ad8e7ed30 100644 --- a/files/helpers/patter.py +++ b/files/helpers/patter.py @@ -3,80 +3,80 @@ from PIL import Image import io pat_frames = [ - Image.open("files/assets/images/pat/0.gif").convert("RGBA"), - Image.open("files/assets/images/pat/1.gif").convert("RGBA"), - Image.open("files/assets/images/pat/2.gif").convert("RGBA"), - Image.open("files/assets/images/pat/3.gif").convert("RGBA"), - Image.open("files/assets/images/pat/4.gif").convert("RGBA"), - Image.open("files/assets/images/pat/5.gif").convert("RGBA"), - Image.open("files/assets/images/pat/6.gif").convert("RGBA"), - Image.open("files/assets/images/pat/7.gif").convert("RGBA"), - Image.open("files/assets/images/pat/8.gif").convert("RGBA"), - Image.open("files/assets/images/pat/9.gif").convert("RGBA") + Image.open("files/assets/images/pat/0.gif").convert("RGBA"), + Image.open("files/assets/images/pat/1.gif").convert("RGBA"), + Image.open("files/assets/images/pat/2.gif").convert("RGBA"), + Image.open("files/assets/images/pat/3.gif").convert("RGBA"), + Image.open("files/assets/images/pat/4.gif").convert("RGBA"), + Image.open("files/assets/images/pat/5.gif").convert("RGBA"), + Image.open("files/assets/images/pat/6.gif").convert("RGBA"), + Image.open("files/assets/images/pat/7.gif").convert("RGBA"), + Image.open("files/assets/images/pat/8.gif").convert("RGBA"), + Image.open("files/assets/images/pat/9.gif").convert("RGBA") ] def getPat(avatar_file, format="webp"): - avatar_x = 5 - avatar_y = 5 - avatar_width = 150 - avatar_height = 150 - image_width = 160 - image_height = 160 - hand_x = 0 - hand_y = 0 - delay = 30 + avatar_x = 5 + avatar_y = 5 + avatar_width = 150 + avatar_height = 150 + image_width = 160 + image_height = 160 + hand_x = 0 + hand_y = 0 + delay = 30 - y_scale = [ - 1, - 0.95, - 0.9, - 0.85, - 0.8, - 0.8, - 0.85, - 0.9, - 0.95, - 1 - ] + y_scale = [ + 1, + 0.95, + 0.9, + 0.85, + 0.8, + 0.8, + 0.85, + 0.9, + 0.95, + 1 + ] - x_scale = [ - 0.80, - 0.85, - 0.90, - 0.95, - 1, - 1, - 0.95, - 0.90, - 0.85, - 0.80 - ] + x_scale = [ + 0.80, + 0.85, + 0.90, + 0.95, + 1, + 1, + 0.95, + 0.90, + 0.85, + 0.80 + ] - frames = [] - avatar_img = Image.open(avatar_file) - for i in range(0, 10): - avatar_actual_x = math.ceil((1 - x_scale[i]) * avatar_width / 2 + avatar_x) - avatar_actual_y = math.ceil((1 - y_scale[i]) * avatar_height + avatar_y) - avatar_actual_width = math.ceil(avatar_width * x_scale[i]) - avatar_actual_height = math.ceil(avatar_height * y_scale[i]) + frames = [] + avatar_img = Image.open(avatar_file) + for i in range(0, 10): + avatar_actual_x = math.ceil((1 - x_scale[i]) * avatar_width / 2 + avatar_x) + avatar_actual_y = math.ceil((1 - y_scale[i]) * avatar_height + avatar_y) + avatar_actual_width = math.ceil(avatar_width * x_scale[i]) + avatar_actual_height = math.ceil(avatar_height * y_scale[i]) - scaled_avatar_img = avatar_img.resize((avatar_actual_width, avatar_actual_height)) - frame = Image.new(mode="RGBA", size=(image_width, image_height)) - frame.paste(scaled_avatar_img, (avatar_actual_x, avatar_actual_y)) - frame.paste(pat_frames[i], (hand_x, hand_y), pat_frames[i]) - frames.append(frame) - - output = io.BytesIO() - frames[0].save(output, format, - save_all = True, - append_images = frames[1:], - duration = delay, - loop = 0 - ) - return output + scaled_avatar_img = avatar_img.resize((avatar_actual_width, avatar_actual_height)) + frame = Image.new(mode="RGBA", size=(image_width, image_height)) + frame.paste(scaled_avatar_img, (avatar_actual_x, avatar_actual_y)) + frame.paste(pat_frames[i], (hand_x, hand_y), pat_frames[i]) + frames.append(frame) + + output = io.BytesIO() + frames[0].save(output, format, + save_all = True, + append_images = frames[1:], + duration = delay, + loop = 0 + ) + return output def pat(emoji): - stream = getPat(open(f'files/assets/images/emojis/{emoji}.webp', "rb"), "webp") - stream.seek(0) - open(f'files/assets/images/emojis/{emoji}pat.webp', "wb").write(stream.read()) \ No newline at end of file + stream = getPat(open(f'files/assets/images/emojis/{emoji}.webp', "rb"), "webp") + stream.seek(0) + open(f'files/assets/images/emojis/{emoji}pat.webp', "wb").write(stream.read()) \ No newline at end of file diff --git a/files/templates/authforms.html b/files/templates/authforms.html index f22d183da..b83658215 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 1cd42cf53..15b144019 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 c1c94cee9..1c34fabdc 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 dd5c32d97..d75ee136a 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 d276a590a..91b7d6f2e 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 799f07783..8ffb170f1 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/post_actions.html b/files/templates/post_actions.html index b1efb9321..1a441e78b 100644 --- a/files/templates/post_actions.html +++ b/files/templates/post_actions.html @@ -1,101 +1,101 @@ {% if v and v.id==p.author_id and p.private %} -
- - -
+
+ + +
{% endif %} {% if not p.ghost or v.id == AEVANN_ID %}Votes{% endif %} {% if v %} - Give Award + Give Award {% endif %} Copy link {% if v %} - Subscribe - Unsubscribe + Subscribe + Unsubscribe {% endif %} {% if v %} - Save - Unsave - - Report + Save + Unsave + + Report {% endif %} {% if v and v.id==p.author_id %} - {% if request.path.startswith('/@') %} - Pin to profile - Unpin from profile - {% endif %} + {% if request.path.startswith('/@') %} + Pin to profile + Unpin from profile + {% endif %} - Undelete + Undelete - Delete - {% endif %} + Delete + {% endif %} - {% if v %} - - + {% endif %} diff --git a/files/templates/post_actions_mobile.html b/files/templates/post_actions_mobile.html index dad978c65..63d063d3d 100644 --- a/files/templates/post_actions_mobile.html +++ b/files/templates/post_actions_mobile.html @@ -1,8 +1,8 @@ {% if v and v.id==p.author_id and p.private %} -
- - -
+
+ + +
{% endif %} @@ -22,43 +22,43 @@ {% if v.id==p.author_id %} - {% if v.admin_level == 1 %} - - - {% endif %} + {% if v.admin_level == 1 %} + + + {% endif %} - {% if request.path.startswith('/@') %} - - - {% endif %} + {% if request.path.startswith('/@') %} + + + {% endif %} - + - + - {% if v.club_allowed != False %} - - - {% endif %} + {% if v.club_allowed != False %} + + + {% endif %} - - + + {% else %} - {% if not p.ghost %} - - - - {% endif %} + {% if not p.ghost %} + + + + {% endif %} {% endif %} {% if p.sub and v.mods(p.sub) %} - + - {% if not p.author.mods(p.sub) %} - - - {% endif %} + {% if not p.author.mods(p.sub) %} + + + {% endif %} {% endif %} diff --git a/files/templates/post_admin_actions_mobile.html b/files/templates/post_admin_actions_mobile.html index fc6edfd75..fa7d5ad79 100644 --- a/files/templates/post_admin_actions_mobile.html +++ b/files/templates/post_admin_actions_mobile.html @@ -1,51 +1,51 @@ diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 4214eb5b4..425101a7e 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 a38082d4e..eef7c5a17 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 b91caff6a..65109a1c5 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 08d29dc96..e54f81b78 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -26,7 +26,7 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %} - + {% endif %} {% endblock %}