From 9aae09ad53c3326382a8fa0b0ad7a105b447a4e9 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Oct 2021 18:06:12 +0200 Subject: [PATCH 01/46] dsf --- files/templates/settings2.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 52ee0c88b..84ab3d4b9 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -39,9 +39,11 @@ {% if v %} - + + {% else %} - + + {% endif %} From f4bddbbca0033b3ddf742d10af4932dff0cd26ac Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Oct 2021 18:06:15 +0200 Subject: [PATCH 02/46] dsf --- files/__main__.py | 2 +- files/templates/authforms.html | 6 ++++-- files/templates/default.html | 4 +++- files/templates/log.html | 4 +++- files/templates/login.html | 1 + files/templates/login_2fa.html | 5 ++--- files/templates/settings.html | 4 ++-- files/templates/sign_up.html | 3 ++- files/templates/sign_up_failed_ref.html | 3 ++- files/templates/submit.html | 4 +++- files/templates/userpage.html | 4 +++- 11 files changed, 26 insertions(+), 14 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index cce320c6e..57025e296 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -40,7 +40,7 @@ app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365 app.config["SESSION_REFRESH_EACH_REQUEST"] = True app.config["SLOGAN"] = environ.get("SLOGAN", "").strip() app.config["DEFAULT_COLOR"] = environ.get("DEFAULT_COLOR", "ff0000").strip() -app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "light").strip() + "_" + environ.get("DEFAULT_COLOR", "ff0000").strip() +app.config["DEFAULT_THEME"] = environ.get("DEFAULT_THEME", "midnight").strip() app.config["FORCE_HTTPS"] = int(environ.get("FORCE_HTTPS", 1)) if ("localhost" not in app.config["SERVER_NAME"] and "127.0.0.1" not in app.config["SERVER_NAME"]) else 0 app.config["UserAgent"] = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36" app.config["HCAPTCHA_SITEKEY"] = environ.get("HCAPTCHA_SITEKEY","").strip() diff --git a/files/templates/authforms.html b/files/templates/authforms.html index c7a0bdb2b..c0f0a5ce0 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -13,10 +13,12 @@ - {% if v %} - + {% if v %} + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 3bf689877..9f60bbc3b 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -249,9 +249,11 @@ {% block stylesheets %} {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index f5661ae64..6c91c45b7 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -16,9 +16,11 @@ {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} diff --git a/files/templates/login.html b/files/templates/login.html index 62c95fc65..9423cd651 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -15,6 +15,7 @@ + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index 62ad32642..f041387db 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -11,9 +11,8 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - - - + + diff --git a/files/templates/settings.html b/files/templates/settings.html index 5d7f5fdff..75aee63ab 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -65,8 +65,8 @@ - - + + {% if v.agendaposter %}{% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 2b31f9991..c6b262802 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -35,7 +35,8 @@ - + + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 51b22861f..4a7e8eb09 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -30,7 +30,8 @@ - + + diff --git a/files/templates/submit.html b/files/templates/submit.html index 5c2eccd41..2a700174a 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -24,9 +24,11 @@ {% block stylesheets %} {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} {% endblock %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index 56f28f938..b70b1ae4a 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -3,9 +3,11 @@ {% if u and u.profilecss %} {% block stylesheets %} {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} + {% endif %} {% if u and u.profilecss %} From 920d2ed843c1cceffa8a703b95f4021666bfe9cc Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Fri, 8 Oct 2021 18:18:15 +0200 Subject: [PATCH 10/46] dfsdfs --- files/templates/authforms.html | 4 ++-- files/templates/default.html | 4 ++-- files/templates/log.html | 4 ++-- files/templates/login.html | 2 +- files/templates/login_2fa.html | 2 +- files/templates/settings.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 ++-- files/templates/userpage.html | 4 ++-- 11 files changed, 17 insertions(+), 17 deletions(-) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index c0f0a5ce0..049cf03a5 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 9f60bbc3b..e1f6e61bb 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,11 +250,11 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/log.html b/files/templates/log.html index 6c91c45b7..4200ebcb7 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -17,11 +17,11 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 9423cd651..0a9e7ffff 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -16,7 +16,7 @@ - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index f041387db..139930b5b 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -12,7 +12,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index 75aee63ab..cbec4fd06 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -66,7 +66,7 @@ - + {% if v.agendaposter %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 84ab3d4b9..6bca63c47 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -40,10 +40,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index c6b262802..0cf4bda32 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -36,7 +36,7 @@ - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 4a7e8eb09..4ba7b4b25 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 2a700174a..b15ec0610 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,11 +25,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/userpage.html b/files/templates/userpage.html index b70b1ae4a..743b941ca 100644 --- a/files/templates/userpage.html +++ b/files/templates/userpage.html @@ -4,11 +4,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} - + {% endif %} {% if u and u.profilecss %} From 0088ec8ad5e4800d666c0ae936c79bd9da205bad Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:04:15 +0200 Subject: [PATCH 23/46] fgf --- files/templates/default.html | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/files/templates/default.html b/files/templates/default.html index e1f6e61bb..c0855395a 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,7 +250,8 @@ {% if v %} - + + {% if v.agendaposter %}{% endif %} {% else %} From d4e56b125aa7892d65c5a58a5162fa7049b8d4a6 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:05:16 +0200 Subject: [PATCH 25/46] fdsdf --- files/templates/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/default.html b/files/templates/default.html index c0855395a..7eadc063d 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -250,7 +250,7 @@ {% if v %} - + {% if v.agendaposter %}{% endif %} {% else %} From f074335f642e9a41741f6071db0401ea221bdcad Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:21:22 +0200 Subject: [PATCH 28/46] dsfdsf --- compilecss.py | 7 ------- files/classes/user.py | 2 +- files/classes/userblock.py | 10 +--------- files/routes/settings.py | 3 --- files/templates/settings_profile.html | 4 ++-- files/templates/submission.html | 2 +- 6 files changed, 5 insertions(+), 23 deletions(-) delete mode 100644 compilecss.py diff --git a/compilecss.py b/compilecss.py deleted file mode 100644 index 923a70f22..000000000 --- a/compilecss.py +++ /dev/null @@ -1,7 +0,0 @@ -for theme in ['transparent', 'win98', 'midnight', 'dark', 'light', 'coffee', 'tron', '4chan']: - with open(f"./files/assets/css/{theme}_ff66ac.css", encoding='utf-8') as t: - text = t.read() - for color in ['ff66ac','805ad5','62ca56','38a169','80ffff','2a96f3','62ca56','eb4963','ff0000','f39731','30409f','3e98a7','e4432d','7b9ae4','ec72de','7f8fa6', 'f8db58']: - newtext = text.replace("ff66ac", color).replace("ff4097", color).replace("ff1a83", color).replace("ff3390", color).replace("rgba(255, 102, 172, 0.25)", color) - with open(f"./files/assets/css/{theme}_{color}.css", encoding='utf-8', mode='w') as nt: - nt.write(newtext) \ No newline at end of file diff --git a/files/classes/user.py b/files/classes/user.py index 9b2c17e02..dd5030171 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -18,7 +18,7 @@ import random site = environ.get("DOMAIN").strip() site_name = environ.get("SITE_NAME").strip() -defaulttheme = environ.get("DEFAULT_THEME", "light").strip() +defaulttheme = environ.get("DEFAULT_THEME", "midnight").strip() defaultcolor = environ.get("DEFAULT_COLOR", "fff").strip() defaulttimefilter = environ.get("DEFAULT_TIME_FILTER", "all").strip() cardview = bool(int(environ.get("CARD_VIEW", 1))) diff --git a/files/classes/userblock.py b/files/classes/userblock.py index b9be3092f..9a3ab1d70 100644 --- a/files/classes/userblock.py +++ b/files/classes/userblock.py @@ -1,8 +1,6 @@ from sqlalchemy import * from sqlalchemy.orm import relationship from files.__main__ import Base -from files.helpers.lazy import lazy -import time class UserBlock(Base): @@ -15,10 +13,4 @@ class UserBlock(Base): target = relationship("User", primaryjoin="User.id==UserBlock.target_id", viewonly=True) def __repr__(self): - - return f"" - - @property - @lazy - def created_date(self): - return time.strftime("%d %b %Y", time.gmtime(self.created_utc)) \ No newline at end of file + return f"" \ No newline at end of file diff --git a/files/routes/settings.py b/files/routes/settings.py index 8eb5ccac6..f4c0b2ee0 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -199,9 +199,6 @@ def settings_profile_post(v): theme = request.values.get("theme") if theme: v.theme = theme - if theme == "coffee" or theme == "4chan": v.themecolor = "38a169" - elif theme == "tron": v.themecolor = "80ffff" - elif theme == "win98": v.themecolor = "30409f" updated = True quadrant = request.values.get("quadrant") diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 2a249b978..9af7b886c 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -97,9 +97,9 @@
- {% if "rdrama" in request.host %} + {% if "rama" in request.host %}
From 5daa6cac77dda228816c04347142255d7ab359dc Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:40:17 +0200 Subject: [PATCH 33/46] dfsfds --- files/templates/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/default.html b/files/templates/default.html index 1c671d586..4beb87031 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -270,7 +270,7 @@ {% if "marsey.tech" not in request.host and '@' not in request.path %} - + {% endif %} From b61c0e86f414a10d89a26ef5086bc1a614cfcd8f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 09:42:15 +0200 Subject: [PATCH 34/46] dsfdsf --- files/templates/delete_post_modal.html | 4 ---- 1 file changed, 4 deletions(-) diff --git a/files/templates/delete_post_modal.html b/files/templates/delete_post_modal.html index 5b355c79f..7ae94dc73 100644 --- a/files/templates/delete_post_modal.html +++ b/files/templates/delete_post_modal.html @@ -36,10 +36,6 @@
- - - -
Delete post?
From d5ddc816c4ce1f1fb349016da96e09098e7d986a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 15:49:13 +0200 Subject: [PATCH 37/46] fdssfd --- files/routes/comments.py | 4 ++-- files/routes/posts.py | 4 ++-- files/routes/settings.py | 3 ++- files/templates/email/default.html | 7 ------- 4 files changed, 6 insertions(+), 12 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 77245dbb8..368b67cc0 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -148,7 +148,7 @@ def api_comment(v): if not body and not request.files.get('file'): return {"error":"You need to actually write something!"}, 400 - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) @@ -579,7 +579,7 @@ def edit_comment(cid, v): if c.is_banned or c.deleted_utc > 0: abort(403) body = request.values.get("body", "")[:10000] - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) diff --git a/files/routes/posts.py b/files/routes/posts.py index e0152e4f1..5464f251d 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -206,7 +206,7 @@ def edit_post(pid, v): p.title_html = filter_title(title) if body != p.body: - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body_md = CustomRenderer().render(mistletoe.Document(body)) body_html = sanitize(body_md) @@ -665,7 +665,7 @@ def submit_post(v): if request.headers.get("Authorization"): return {"error":"2048 character limit for URLs."}, 400 else: return render_template("submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.values.get("body", "")), 400 - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): if "wikipedia" not in i.group(1): body = body.replace(i.group(1), f'![]({i.group(1)})') body = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', body) diff --git a/files/routes/settings.py b/files/routes/settings.py index c6e122ebf..2fb6466af 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -103,7 +103,7 @@ def settings_profile_post(v): if request.values.get("bio"): bio = request.values.get("bio")[:1500] - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', bio, re.MULTILINE): + for i in re.finditer('(^| )(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', bio, re.MULTILINE): if "wikipedia" not in i.group(1): bio = bio.replace(i.group(1), f'![]({i.group(1)})') bio = re.sub('([^\n])\n([^\n])', r'\1\n\n\2', bio) @@ -199,6 +199,7 @@ def settings_profile_post(v): theme = request.values.get("theme") if theme: v.theme = theme + if theme == "win98": v.themecolor = "30409f" updated = True quadrant = request.values.get("quadrant") diff --git a/files/templates/email/default.html b/files/templates/email/default.html index f5396d90a..476d4faa6 100644 --- a/files/templates/email/default.html +++ b/files/templates/email/default.html @@ -366,13 +366,6 @@ } } - {% block preheader %}Thanks for joining {{'SITE_NAME' | app_config}}! Please take a sec to verify the email you used to sign up.{% endblock %} From 84840d9fa05c961f1c82d29ed65bb19eff22bb3c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 9 Oct 2021 16:02:47 +0200 Subject: [PATCH 38/46] dsfsfd --- files/templates/header.html | 2 +- files/templates/mobile_navigation_bar.html | 12 ++++++------ files/templates/notifications.html | 2 +- files/templates/settings.html | 11 ----------- files/templates/settings_security.html | 16 ++++++++++++---- 5 files changed, 20 insertions(+), 23 deletions(-) diff --git a/files/templates/header.html b/files/templates/header.html index 15414bd7e..bfb1dfe9f 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -96,7 +96,7 @@
{{v.username}}
-
{{v.coins}} {{'COINS_NAME' | app_config}}
+
{{v.coins}} {{'COINS_NAME' | app_config}}
diff --git a/files/templates/mobile_navigation_bar.html b/files/templates/mobile_navigation_bar.html index 72466e002..49e65868a 100644 --- a/files/templates/mobile_navigation_bar.html +++ b/files/templates/mobile_navigation_bar.html @@ -13,7 +13,7 @@