From 5090fcd105460a7a110ecaa482f5fc3e52cbdca8 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 04:59:40 +0200 Subject: [PATCH 01/27] sfdsfdfsd --- files/__main__.py | 1 - files/helpers/sanitize.py | 4 +- files/routes/comments.py | 34 ++++++---- files/routes/posts.py | 51 +++++++-------- files/routes/settings.py | 65 ++++--------------- .../CHRISTMAS/comments/CommentEditForm.html | 4 +- .../CHRISTMAS/comments/CommentForm.html | 2 +- .../CHRISTMAS/comments/CommentReplyForm.html | 4 +- .../templates/CHRISTMAS/settings_profile.html | 2 +- files/templates/comments.html | 4 +- files/templates/settings_profile.html | 2 +- files/templates/submission.html | 4 +- files/templates/submit.html | 2 +- 13 files changed, 73 insertions(+), 106 deletions(-) diff --git a/files/__main__.py b/files/__main__.py index 7aa87735f1..d9dbd4b2d7 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -54,7 +54,6 @@ app.config["SPAM_SIMILAR_COUNT_THRESHOLD"] = int(environ.get("SPAM_SIMILAR_COUNT app.config["SPAM_URL_SIMILARITY_THRESHOLD"] = float(environ.get("SPAM_URL_SIMILARITY_THRESHOLD", 0.5)) app.config["COMMENT_SPAM_SIMILAR_THRESHOLD"] = float(environ.get("COMMENT_SPAM_SIMILAR_THRESHOLD", 0.5)) app.config["COMMENT_SPAM_COUNT_THRESHOLD"] = int(environ.get("COMMENT_SPAM_COUNT_THRESHOLD", 0.5)) -app.config["VIDEO_COIN_REQUIREMENT"] = int(environ.get("VIDEO_COIN_REQUIREMENT", 0)) app.config["READ_ONLY"]=bool(int(environ.get("READ_ONLY", "0"))) app.config["BOT_DISABLE"]=bool(int(environ.get("BOT_DISABLE", False))) app.config["RATELIMIT_KEY_PREFIX"] = "flask_limiting_" diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 529475fabc..68a487ea05 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -216,8 +216,8 @@ def sanitize(sanitized, noimages=False): htmlsource += '">' sanitized = sanitized.replace(replacing, htmlsource) - for i in re.finditer('

(https:.*?\.(mp4|webm))

', sanitized): - sanitized = sanitized.replace(i.group(0), f'

') + for i in re.finditer('>(https://.*?\.(mp4|webm|mov))

', sanitized): + sanitized = sanitized.replace(f'

{i.group(1)}

', f'

') for rd in ["https://reddit.com/", "https://new.reddit.com/", "https://www.reddit.com/", "https://redd.it/"]: sanitized = sanitized.replace(rd, "https://old.reddit.com/") diff --git a/files/routes/comments.py b/files/routes/comments.py index fd17f19340..3819571eb2 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -10,10 +10,12 @@ from pusher_push_notifications import PushNotifications from flask import * from files.__main__ import app, limiter from files.helpers.sanitize import filter_emojis_only +import requests site = environ.get("DOMAIN").strip() if site == 'pcmemes.net': cc = "SPLASH MOUNTAIN" else: cc = "COUNTRY CLUB" +CATBOX_KEY = environ.get("CATBOX_KEY").strip() beams_client = PushNotifications( instance_id=PUSHER_INSTANCE_ID, @@ -190,13 +192,17 @@ def api_comment(v): if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1": file=request.files["file"] - if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400 + if file.content_type.startswith('image/'): + name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' + file.save(name) + url = process_image(name) + elif file.content_type.startswith('video/'): + file.save("video.mp4") + with open("video.mp4", 'rb') as f: + url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + else: return {"error": f"Image/Video files only"}, 400 - name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' - file.save(name) - url = process_image(name) - - body += f"\n\n![]({url})" + body += f"\n\n{url}" if v.agendaposter and not v.marseyawarded: for k, l in AJ_REPLACEMENTS.items(): body = body.replace(k, l) @@ -720,13 +726,17 @@ def edit_comment(cid, v): if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1": file=request.files["file"] - if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400 + if file.content_type.startswith('image/'): + name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' + file.save(name) + url = process_image(name) + elif file.content_type.startswith('video/'): + file.save("video.mp4") + with open("video.mp4", 'rb') as f: + url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + else: return {"error": f"Image/Video files only"}, 400 - name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' - file.save(name) - url = process_image(name) - - body += f"\n\n![]({url})" + body += f"\n\n{url}" 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 5e9a49afa7..7b89b10d06 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -18,6 +18,7 @@ from PIL import Image as PILimage from .front import frontlist, changeloglist from urllib.parse import ParseResult, urlunparse, urlparse, quote from os import path +import requests site = environ.get("DOMAIN").strip() site_name = environ.get("SITE_NAME").strip() @@ -420,13 +421,17 @@ def edit_post(pid, v): if request.files.get("file") and request.headers.get("cf-ipcountry") != "T1": file=request.files["file"] - if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400 + if file.content_type.startswith('image/'): + name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' + file.save(name) + url = process_image(name) + elif file.content_type.startswith('video/'): + file.save("video.mp4") + with open("video.mp4", 'rb') as f: + url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + else: return {"error": f"Image/Video files only"}, 400 - name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' - file.save(name) - url = process_image(name) - - body += f"\n\n![]({url})" + body += f"\n\n{url}" if body != p.body: for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|webp|PNG|JPG|JPEG|GIF|WEBP|9999))', body, re.MULTILINE): @@ -916,13 +921,19 @@ def submit_post(v): if request.files.get("file2") and request.headers.get("cf-ipcountry") != "T1": file=request.files["file2"] - if not file.content_type.startswith('image/'): return {"error": "That wasn't an image!"}, 400 + if file.content_type.startswith('image/'): + name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' + file.save(name) + url = process_image(name) + elif file.content_type.startswith('video/'): + file.save("video.mp4") + with open("video.mp4", 'rb') as f: + url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + else: + if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400 + else: return render_template("submit.html", v=v, error=f"Image/Video files only."), 400 - name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' - file.save(name) - url = process_image(name) - - body += f"\n\n![]({url})" + body += f"\n\n{url}" body_html = sanitize(CustomRenderer().render(mistletoe.Document(body))) @@ -1003,20 +1014,6 @@ def submit_post(v): if request.headers.get("Authorization"): return {"error": f"File type not allowed"}, 400 else: return render_template("submit.html", v=v, error=f"File type not allowed.", title=title, body=request.values.get("body", "")), 400 - if file.content_type.startswith('video/') and v.truecoins < app.config["VIDEO_COIN_REQUIREMENT"] and v.admin_level < 1: - if request.headers.get("Authorization"): - return { - "error": f"You need at least {app.config['VIDEO_COIN_REQUIREMENT']} coins to upload videos" - }, 403 - else: - return render_template( - "submit.html", - v=v, - error=f"You need at least {app.config['VIDEO_COIN_REQUIREMENT']} coins to upload videos.", - title=title, - body=request.values.get("body", "") - ), 403 - if file.content_type.startswith('image/'): name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' file.save(name) @@ -1025,7 +1022,7 @@ def submit_post(v): elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: - new_post.url = requests.post('https://catbox.moe/user/api.php', timeout=5, data={'userhash':CATBOX_KEY, 'reqtype':'fileupload'}, files={'fileToUpload':f}).text + url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] g.db.add(new_post) diff --git a/files/routes/settings.py b/files/routes/settings.py index e8a4caac7e..a3270acb26 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -22,6 +22,7 @@ YOUTUBE_KEY = environ.get("YOUTUBE_KEY", "").strip() COINS_NAME = environ.get("COINS_NAME").strip() GUMROAD_TOKEN = environ.get("GUMROAD_TOKEN", "").strip() SITE_NAME = environ.get("SITE_NAME", "").strip() +CATBOX_KEY = environ.get("CATBOX_KEY").strip() tiers={ "(Paypig)": 1, @@ -116,50 +117,6 @@ def settings_profile_post(v): updated = True v.is_nofollow = request.values.get("nofollow", None) == 'true' - elif request.values.get("bio") or request.files.get('file') and request.headers.get("cf-ipcountry") != "T1": - 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): - if "wikipedia" not in i.group(1): bio = bio.replace(i.group(1), f'![]({i.group(1)})') - - if request.files.get('file'): - file = request.files['file'] - if not file.content_type.startswith('image/'): - if request.headers.get("Authorization"): return {"error": f"Image files only"}, 400 - else: return render_template("settings_profile.html", v=v, error=f"Image files only."), 400 - - name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' - file.save(name) - url = process_image(name) - - bio += f"\n\n![]({url})" - - bio_html = CustomRenderer().render(mistletoe.Document(bio)) - bio_html = sanitize(bio_html) - bans = filter_comment_html(bio_html) - - if bans: - ban = bans[0] - reason = f"Remove the {ban.domain} link from your bio and try again." - if ban.reason: - reason += f" {ban.reason}" - - return {"error": reason}, 401 - - if len(bio_html) > 10000: - return render_template("settings_profile.html", - v=v, - error="Your bio is too long") - - v.bio = bio[:1500] - v.bio_html=bio_html - g.db.add(v) - g.db.commit() - return render_template("settings_profile.html", - v=v, - msg="Your bio has been updated.") - - elif request.values.get("bio") == "": v.bio = None v.bio_html = None @@ -314,15 +271,19 @@ def settings_profile_post(v): if request.files.get('file'): file = request.files['file'] - if not file.content_type.startswith('image/'): - if request.headers.get("Authorization"): return {"error": f"Image files only"}, 400 - else: return render_template("settings_profile.html", v=v, error=f"Image files only."), 400 + if file.content_type.startswith('image/'): + name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' + file.save(name) + url = process_image(name) + elif file.content_type.startswith('video/'): + file.save("video.mp4") + with open("video.mp4", 'rb') as f: + url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + else: + if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400 + else: return render_template("settings_profile.html", v=v, error=f"Image/Video files only."), 400 - name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' - file.save(name) - url = process_image(name) - - bio += f"\n\n![]({url})" + bio += f"\n\n{url}" bio_html = CustomRenderer().render(mistletoe.Document(bio)) bio_html = sanitize(bio_html) diff --git a/files/templates/CHRISTMAS/comments/CommentEditForm.html b/files/templates/CHRISTMAS/comments/CommentEditForm.html index bfbfcecf54..0e558f4125 100644 --- a/files/templates/CHRISTMAS/comments/CommentEditForm.html +++ b/files/templates/CHRISTMAS/comments/CommentEditForm.html @@ -34,7 +34,7 @@

- + {% endif %} @@ -60,7 +60,7 @@   diff --git a/files/templates/CHRISTMAS/comments/CommentForm.html b/files/templates/CHRISTMAS/comments/CommentForm.html index 2728c9826e..7902d7a75e 100644 --- a/files/templates/CHRISTMAS/comments/CommentForm.html +++ b/files/templates/CHRISTMAS/comments/CommentForm.html @@ -35,7 +35,7 @@
- + {% endif %} diff --git a/files/templates/CHRISTMAS/comments/CommentReplyForm.html b/files/templates/CHRISTMAS/comments/CommentReplyForm.html index c613ec0a01..286c100316 100644 --- a/files/templates/CHRISTMAS/comments/CommentReplyForm.html +++ b/files/templates/CHRISTMAS/comments/CommentReplyForm.html @@ -36,7 +36,7 @@
- + {% endif %} @@ -67,7 +67,7 @@   diff --git a/files/templates/CHRISTMAS/settings_profile.html b/files/templates/CHRISTMAS/settings_profile.html index 13c80f9c34..266069dd6a 100644 --- a/files/templates/CHRISTMAS/settings_profile.html +++ b/files/templates/CHRISTMAS/settings_profile.html @@ -96,7 +96,7 @@
diff --git a/files/templates/comments.html b/files/templates/comments.html index fe95ca9dbd..038c4efcc3 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -288,7 +288,7 @@ Save Edit @@ -464,7 +464,7 @@   Comment diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 46c1bd6709..06ede4155f 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -544,7 +544,7 @@  

diff --git a/files/templates/submission.html b/files/templates/submission.html
index 4fd25dc694..86f44e7a9b 100644
--- a/files/templates/submission.html
+++ b/files/templates/submission.html
@@ -477,7 +477,7 @@
 
 										
 						
 										 
@@ -751,7 +751,7 @@
 				 
 				
 			
 			Comment
diff --git a/files/templates/submit.html b/files/templates/submit.html
index 213786b26f..926aab380a 100644
--- a/files/templates/submit.html
+++ b/files/templates/submit.html
@@ -122,7 +122,7 @@
 																
 														
 
 												


From bf5144e02c264525994fea9eb709ba251acbfd9c Mon Sep 17 00:00:00 2001
From: Aevann1 
Date: Sat, 18 Dec 2021 05:01:36 +0200
Subject: [PATCH 02/27] sfdfsd

---
 files/templates/CHRISTMAS/comments/CommentEditForm.html  | 4 ++--
 files/templates/CHRISTMAS/comments/CommentForm.html      | 2 +-
 files/templates/CHRISTMAS/comments/CommentReplyForm.html | 4 ++--
 files/templates/comments.html                            | 4 ++--
 files/templates/settings_profile.html                    | 2 +-
 files/templates/submission.html                          | 4 ++--
 files/templates/submit.html                              | 2 +-
 7 files changed, 11 insertions(+), 11 deletions(-)

diff --git a/files/templates/CHRISTMAS/comments/CommentEditForm.html b/files/templates/CHRISTMAS/comments/CommentEditForm.html
index 0e558f4125..1be38ccac4 100644
--- a/files/templates/CHRISTMAS/comments/CommentEditForm.html
+++ b/files/templates/CHRISTMAS/comments/CommentEditForm.html
@@ -34,7 +34,7 @@
 						
- + {% endif %} @@ -60,7 +60,7 @@   diff --git a/files/templates/CHRISTMAS/comments/CommentForm.html b/files/templates/CHRISTMAS/comments/CommentForm.html index 7902d7a75e..60bc6562a4 100644 --- a/files/templates/CHRISTMAS/comments/CommentForm.html +++ b/files/templates/CHRISTMAS/comments/CommentForm.html @@ -35,7 +35,7 @@
- + {% endif %} diff --git a/files/templates/CHRISTMAS/comments/CommentReplyForm.html b/files/templates/CHRISTMAS/comments/CommentReplyForm.html index 286c100316..aa8960f531 100644 --- a/files/templates/CHRISTMAS/comments/CommentReplyForm.html +++ b/files/templates/CHRISTMAS/comments/CommentReplyForm.html @@ -36,7 +36,7 @@
- + {% endif %} @@ -67,7 +67,7 @@   diff --git a/files/templates/comments.html b/files/templates/comments.html index 038c4efcc3..300eb311ff 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -288,7 +288,7 @@ Save Edit @@ -464,7 +464,7 @@   Comment diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 06ede4155f..20228ad53f 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -544,7 +544,7 @@  

diff --git a/files/templates/submission.html b/files/templates/submission.html
index 86f44e7a9b..b382305ea4 100644
--- a/files/templates/submission.html
+++ b/files/templates/submission.html
@@ -477,7 +477,7 @@
 
 										
 						
 										 
@@ -751,7 +751,7 @@
 				 
 				
 			
 			Comment
diff --git a/files/templates/submit.html b/files/templates/submit.html
index 926aab380a..1854a833d5 100644
--- a/files/templates/submit.html
+++ b/files/templates/submit.html
@@ -122,7 +122,7 @@
 																
 														
 
 												


From efdc3b67faff94370f5da1e0e70dd090f137d459 Mon Sep 17 00:00:00 2001
From: Aevann1 
Date: Sat, 18 Dec 2021 05:04:17 +0200
Subject: [PATCH 03/27] sdffsd

---
 files/templates/CHRISTMAS/authforms.html          | 4 ++--
 files/templates/CHRISTMAS/default.html            | 2 +-
 files/templates/CHRISTMAS/login.html              | 4 ++--
 files/templates/CHRISTMAS/login_2fa.html          | 2 +-
 files/templates/CHRISTMAS/settings.html           | 4 ++--
 files/templates/CHRISTMAS/sign_up.html            | 4 ++--
 files/templates/CHRISTMAS/sign_up_failed_ref.html | 2 +-
 files/templates/CHRISTMAS/tailwind.html           | 2 +-
 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 ++--
 18 files changed, 27 insertions(+), 27 deletions(-)

diff --git a/files/templates/CHRISTMAS/authforms.html b/files/templates/CHRISTMAS/authforms.html
index 22ef91814b..d8635c3376 100644
--- a/files/templates/CHRISTMAS/authforms.html
+++ b/files/templates/CHRISTMAS/authforms.html
@@ -14,11 +14,11 @@
 
 		{% if v %}
 			
-			
+			
 			{% if v.agendaposter %}{% elif v.css %}{% endif %}
 		{% else %}
 			
-			
+			
 		{% endif %}
 
 
diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html
index f342611737..98ee4b8df3 100644
--- a/files/templates/CHRISTMAS/default.html
+++ b/files/templates/CHRISTMAS/default.html
@@ -188,7 +188,7 @@
 
 		
 
-      	
+      	
 
     	
 
diff --git a/files/templates/CHRISTMAS/login.html b/files/templates/CHRISTMAS/login.html
index 5b36e23ca6..55791cbccc 100644
--- a/files/templates/CHRISTMAS/login.html
+++ b/files/templates/CHRISTMAS/login.html
@@ -13,9 +13,9 @@
 	Login -	{{'SITE_NAME' | app_config}}
 	{% endblock %}
 
-	
+	
 
-	
+	
 
 	
 
diff --git a/files/templates/CHRISTMAS/login_2fa.html b/files/templates/CHRISTMAS/login_2fa.html
index 9da94605df..7d99a790f1 100644
--- a/files/templates/CHRISTMAS/login_2fa.html
+++ b/files/templates/CHRISTMAS/login_2fa.html
@@ -13,7 +13,7 @@
 		2-Step Login - {{'SITE_NAME' | app_config}}
 
 		
-		
+		
 
 
 
diff --git a/files/templates/CHRISTMAS/settings.html b/files/templates/CHRISTMAS/settings.html
index 11f24f2c6e..b0d4ac39e4 100644
--- a/files/templates/CHRISTMAS/settings.html
+++ b/files/templates/CHRISTMAS/settings.html
@@ -29,9 +29,9 @@
 
 	{% block stylesheets %}
 
-	
+	
 
-  	
+  	
 
 	
 
diff --git a/files/templates/CHRISTMAS/sign_up.html b/files/templates/CHRISTMAS/sign_up.html
index 42356460ec..05408e455f 100644
--- a/files/templates/CHRISTMAS/sign_up.html
+++ b/files/templates/CHRISTMAS/sign_up.html
@@ -26,9 +26,9 @@
 
 	{% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %}
 
-	
+	
 
-	
+	
 
 	
 
diff --git a/files/templates/CHRISTMAS/sign_up_failed_ref.html b/files/templates/CHRISTMAS/sign_up_failed_ref.html
index a0a64badc9..877a636eef 100644
--- a/files/templates/CHRISTMAS/sign_up_failed_ref.html
+++ b/files/templates/CHRISTMAS/sign_up_failed_ref.html
@@ -31,7 +31,7 @@
 		{% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %}
 
 		
-		
+		
 
 
 
diff --git a/files/templates/CHRISTMAS/tailwind.html b/files/templates/CHRISTMAS/tailwind.html
index 55e6e293e3..9279047bfc 100644
--- a/files/templates/CHRISTMAS/tailwind.html
+++ b/files/templates/CHRISTMAS/tailwind.html
@@ -5,7 +5,7 @@
     
     
 
-    
+    
 
     Flask + Tailwind CSS
   
diff --git a/files/templates/authforms.html b/files/templates/authforms.html
index 1bbf37b363..cfbbc40bf3 100644
--- a/files/templates/authforms.html
+++ b/files/templates/authforms.html
@@ -14,11 +14,11 @@
 
 		{% if v %}
 			
-			
+			
 			{% if v.agendaposter %}{% elif v.css %}{% endif %}
 		{% else %}
 			
-			
+			
 		{% endif %}
 
 
diff --git a/files/templates/default.html b/files/templates/default.html
index 5d94d4319b..8c0df2c6eb 100644
--- a/files/templates/default.html
+++ b/files/templates/default.html
@@ -6,12 +6,12 @@
 	
 	{% if v %}
 		
-		
+		
 		
 		{% if v.agendaposter %}{% elif v.css %}{% endif %}
 	{% else %}
 		
-		
+		
 	{% endif %}
 
 	 
diff --git a/files/templates/log.html b/files/templates/log.html
index 8761cf39d8..191cfedef4 100644
--- a/files/templates/log.html
+++ b/files/templates/log.html
@@ -6,11 +6,11 @@
 {% block content %}
 {% if v %}
 	
-	
+	
 	{% if v.agendaposter %}{% elif v.css %}{% endif %}
 {% else %}
 	
-	
+	
 {% endif %}
 
 
diff --git a/files/templates/login.html b/files/templates/login.html index 9c9c5a8058..4bad266f79 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -17,7 +17,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index eab0352920..e12271e224 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -13,7 +13,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index ef3e3211b9..fb454f7771 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -33,7 +33,7 @@ - + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 40d3257f83..88634e1abb 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -38,10 +38,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index b0e483a581..501d5558de 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -30,7 +30,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 2e2387b64f..7de91792dc 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 1854a833d5..14446d8c6e 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,11 +25,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} From 6594777e0faa855dd109c459ca98975781d1750f Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 05:13:46 +0200 Subject: [PATCH 04/27] fsdfsd --- files/classes/submission.py | 5 +++++ files/templates/CHRISTMAS/submission.html | 16 +++++++++------- .../templates/CHRISTMAS/submission_listing.html | 4 +++- files/templates/formatting.html | 7 +------ files/templates/submission.html | 13 ++----------- files/templates/submission_listing.html | 12 ++---------- 6 files changed, 22 insertions(+), 35 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 69cd36ce74..7460e03a5b 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -397,6 +397,11 @@ class Submission(Base): return title + @property + @lazy + def is_video(self): + return self.url and any((self.url.lower().endswith(x) for x in ('.mp4','.webm','.mov'))) + @property @lazy def is_image(self): diff --git a/files/templates/CHRISTMAS/submission.html b/files/templates/CHRISTMAS/submission.html index bc857a5180..399ce55003 100644 --- a/files/templates/CHRISTMAS/submission.html +++ b/files/templates/CHRISTMAS/submission.html @@ -304,6 +304,8 @@ {% if p.is_image %} (image post) + {% elif p.is_video %} + (video post) {% elif p.realurl(v) %} ({{p.domain}}) @@ -352,13 +354,13 @@ {% endif %}
{% if p.is_image %} - - Unable to load image - - {% elif p.url and p.url.lower().endswith('.mp4') %} - + + Unable to load image + + {% elif p.is_video %} + {% endif %} {{p.realbody(v) | safe}} diff --git a/files/templates/CHRISTMAS/submission_listing.html b/files/templates/CHRISTMAS/submission_listing.html index 7275847fdf..d91fd25f48 100644 --- a/files/templates/CHRISTMAS/submission_listing.html +++ b/files/templates/CHRISTMAS/submission_listing.html @@ -149,6 +149,8 @@ {% if p.is_image %} (image post) + {% if p.is_video %} + (video post) {% elif p.realurl(v) %} ({{p.domain}}) @@ -285,7 +287,7 @@ {% endif %} {% if not p.club or v and (v.paid_dues or v.id == p.author_id) %} - {% if p.url and p.url.lower().endswith('.mp4') %} + {% if p.is_video %}

-							{% elif p.url and p.url.lower().endswith('.mp4') %}
+							{% elif p.is_video %}
 								

-							{% elif p.url and p.url.lower().endswith('.webm') %}
-								
-
- -
-
-

 							{% endif %}
 							{{p.realbody(v) | safe}}
 
diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html
index 3338aac2e6..390dd8c48a 100644
--- a/files/templates/submission_listing.html
+++ b/files/templates/submission_listing.html
@@ -185,7 +185,7 @@
 				{{p.author.username}}{% if p.author.customtitle %}  {% if p.author.quadrant %}{% endif %}{{p.author.customtitle | safe}}{% endif %}
 				 {{p.age_string}}
 				 
-				({% if p.is_image %}image post{% elif p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %})
+				({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %})
 				{% if p.edited_utc %}
 					  Edited {{p.edited_string}}
 				{% endif %}
@@ -506,20 +506,12 @@
 				Unable to load image
 			
 		
- {% endif %} - - {% if p.url and p.url.lower().endswith('.mp4') %} + {% elif p.is_video %}
- {% elif p.url and p.url.lower().endswith('.webm') %} -
- -
{% elif p.embed_url and p.domain in ['youtu.be','youtube.com'] and p.embed_url.startswith(' {{p.embed_url | safe}} From 76af1e5c15e0562db9f1771bded9fb6aa6e24659 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 05:17:06 +0200 Subject: [PATCH 05/27] fdsfds --- files/templates/CHRISTMAS/submission_listing.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/CHRISTMAS/submission_listing.html b/files/templates/CHRISTMAS/submission_listing.html index d91fd25f48..726a039a57 100644 --- a/files/templates/CHRISTMAS/submission_listing.html +++ b/files/templates/CHRISTMAS/submission_listing.html @@ -149,7 +149,7 @@ {% if p.is_image %} (image post) - {% if p.is_video %} + {% elif p.is_video %} (video post) {% elif p.realurl(v) %} From a6b11fdadf50be37ce857063f1e9e0ded5861978 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 05:19:10 +0200 Subject: [PATCH 06/27] sfdds --- files/templates/CHRISTMAS/formatting.html | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/files/templates/CHRISTMAS/formatting.html b/files/templates/CHRISTMAS/formatting.html index 6333c49d09..595ed99fe8 100644 --- a/files/templates/CHRISTMAS/formatting.html +++ b/files/templates/CHRISTMAS/formatting.html @@ -62,15 +62,10 @@ You can use Markdown formatting: - MP4 Files + Video Files https://files.catbox.moe/v4om92.mp4 - - WEBM Files - https://files.catbox.moe/v4om92.mp4 - - Emojis :marseylove: From 431b1ca08b865e4c879d5867da418beba9089266 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 05:31:08 +0200 Subject: [PATCH 08/27] fsdsfd --- files/templates/comments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 300eb311ff..ccbb3add5b 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -231,7 +231,7 @@
removed by @{{c.ban_reason}}
{% endif %} -
+
{{c.realbody(v) | safe}} {% if c.options %} {{c.options_html(v) | safe}} From 9eab8440d3e935ba1494c83b38ea182ccf32642c Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 05:33:00 +0200 Subject: [PATCH 09/27] fdsfdsdf --- files/helpers/wrappers.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/helpers/wrappers.py b/files/helpers/wrappers.py index fe7c3073bc..2dece7a26d 100644 --- a/files/helpers/wrappers.py +++ b/files/helpers/wrappers.py @@ -18,8 +18,7 @@ def get_logged_in_user(): nonce = session.get("login_nonce", 0) logged_in = session.get("logged_in") - if not uid: return None - # if not uid or not logged_in or uid != logged_in: return None + if not uid or not logged_in or uid != logged_in: return None try: if g.db: v = g.db.query(User).filter_by(id=uid).first() From dbae5871a7e670d50260dc8e8af474ef763c0130 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 05:39:31 +0200 Subject: [PATCH 10/27] fdsfsd --- files/routes/front.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 48a77c3c0a..901edcb47b 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -123,8 +123,7 @@ def notifications(v): @auth_desired def front_all(v): - if request.host == 'old.rdrama.net' and not (v and (v.admin_level or v.patron)): - return render_template("home.html", v=v, listing=[], next_exists=False, sort='hot', t='all', page=1) + return render_template("home.html", v=v, listing=[], next_exists=False, sort='hot', t='all', page=1) if not v and request.path == "/" and not request.headers.get("Authorization"): return redirect(f"/logged_out{request.full_path}") From 409c756d9ae359999b3ad8f6f02e667db9a07347 Mon Sep 17 00:00:00 2001 From: kek7198 Date: Fri, 17 Dec 2021 21:40:36 -0600 Subject: [PATCH 11/27] fix --- files/templates/CHRISTMAS/default.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html index 98ee4b8df3..7d58a80fd9 100644 --- a/files/templates/CHRISTMAS/default.html +++ b/files/templates/CHRISTMAS/default.html @@ -346,8 +346,8 @@ {% if v %} - {% endif %} + From 73db5710d4da1a3b325643bc3076338de445f808 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 05:43:16 +0200 Subject: [PATCH 12/27] fdsfds --- files/routes/front.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/files/routes/front.py b/files/routes/front.py index 901edcb47b..8700fe6181 100644 --- a/files/routes/front.py +++ b/files/routes/front.py @@ -123,8 +123,6 @@ def notifications(v): @auth_desired def front_all(v): - return render_template("home.html", v=v, listing=[], next_exists=False, sort='hot', t='all', page=1) - if not v and request.path == "/" and not request.headers.get("Authorization"): return redirect(f"/logged_out{request.full_path}") if v and v.is_banned and not v.unban_utc: return render_template('errors/500.html', error=True, v=v), 500 From 72405e77f30ed7306c60c6b7a77c8f2fe5216283 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 06:48:10 +0200 Subject: [PATCH 13/27] fdsfds --- files/routes/comments.py | 7 ++++--- files/routes/posts.py | 9 ++++----- files/routes/settings.py | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/files/routes/comments.py b/files/routes/comments.py index 3819571eb2..f6866813fc 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -196,14 +196,14 @@ def api_comment(v): name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' file.save(name) url = process_image(name) + body += f"\n\n![]({url})" elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + body += f"\n\n{url}" else: return {"error": f"Image/Video files only"}, 400 - body += f"\n\n{url}" - if v.agendaposter and not v.marseyawarded: for k, l in AJ_REPLACEMENTS.items(): body = body.replace(k, l) body = body.replace('I ', f'@{v.username} ') @@ -730,13 +730,14 @@ def edit_comment(cid, v): name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' file.save(name) url = process_image(name) + body += f"\n\n![]({url})" elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + body += f"\n\n{url}" else: return {"error": f"Image/Video files only"}, 400 - body += f"\n\n{url}" 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 7b89b10d06..0bc9057048 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -425,14 +425,14 @@ def edit_post(pid, v): name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' file.save(name) url = process_image(name) + body += f"\n\n![]({url})" elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + body += f"\n\n{url}" else: return {"error": f"Image/Video files only"}, 400 - body += f"\n\n{url}" - if body != p.body: 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)})') @@ -924,17 +924,16 @@ def submit_post(v): if file.content_type.startswith('image/'): name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' file.save(name) - url = process_image(name) + body += f"\n\n![]({url})" elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + body += f"\n\n{url}" else: if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400 else: return render_template("submit.html", v=v, error=f"Image/Video files only."), 400 - body += f"\n\n{url}" - body_html = sanitize(CustomRenderer().render(mistletoe.Document(body))) if v.marseyawarded and len(list(re.finditer('>[^<\s+]|[^>\s+]<', body_html))) > 0: return {"error":"You can only type marseys!"}, 400 diff --git a/files/routes/settings.py b/files/routes/settings.py index a3270acb26..f57adcbaac 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -275,15 +275,15 @@ def settings_profile_post(v): name = f'/images/{time.time()}'.replace('.','')[:-5] + '.webp' file.save(name) url = process_image(name) + bio += f"\n\n![]({url})" elif file.content_type.startswith('video/'): file.save("video.mp4") with open("video.mp4", 'rb') as f: url = requests.request("POST", "https://api.imgur.com/3/upload", headers={'Authorization': f'Client-ID {CATBOX_KEY}'}, files=[('video', f)]).json()['data']['link'] + bio += f"\n\n{url}" else: if request.headers.get("Authorization"): return {"error": f"Image/Video files only"}, 400 else: return render_template("settings_profile.html", v=v, error=f"Image/Video files only."), 400 - - bio += f"\n\n{url}" bio_html = CustomRenderer().render(mistletoe.Document(bio)) bio_html = sanitize(bio_html) From 817bf6398dd79238ffb69712c75b7cbb578134e0 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 20:11:11 +0200 Subject: [PATCH 14/27] fsdfds --- files/templates/comments.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index ccbb3add5b..74994f4b0e 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -382,7 +382,7 @@ {% endif %} {% if v and c.post and (v.admin_level > 1 or v.id == c.post.author_id) %} - + {% endif %} From 530d54eb4a46f8f216425538a3acdc401ef54171 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 20:25:11 +0200 Subject: [PATCH 15/27] dfsfsd --- files/templates/CHRISTMAS/authforms.html | 4 ++-- files/templates/CHRISTMAS/default.html | 4 ++-- files/templates/CHRISTMAS/login.html | 4 ++-- files/templates/CHRISTMAS/login_2fa.html | 2 +- files/templates/CHRISTMAS/settings.html | 4 ++-- files/templates/CHRISTMAS/sign_up.html | 4 ++-- files/templates/CHRISTMAS/sign_up_failed_ref.html | 2 +- files/templates/CHRISTMAS/tailwind.html | 2 +- files/templates/authforms.html | 4 ++-- files/templates/comments.html | 13 +++++++------ 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 ++-- 19 files changed, 35 insertions(+), 34 deletions(-) diff --git a/files/templates/CHRISTMAS/authforms.html b/files/templates/CHRISTMAS/authforms.html index d8635c3376..81f5e76ad0 100644 --- a/files/templates/CHRISTMAS/authforms.html +++ b/files/templates/CHRISTMAS/authforms.html @@ -14,11 +14,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html index 7d58a80fd9..0fbf3f6ef0 100644 --- a/files/templates/CHRISTMAS/default.html +++ b/files/templates/CHRISTMAS/default.html @@ -186,9 +186,9 @@ {% block stylesheets %} - + - + diff --git a/files/templates/CHRISTMAS/login.html b/files/templates/CHRISTMAS/login.html index 55791cbccc..8c20ce292f 100644 --- a/files/templates/CHRISTMAS/login.html +++ b/files/templates/CHRISTMAS/login.html @@ -13,9 +13,9 @@ Login - {{'SITE_NAME' | app_config}} {% endblock %} - + - + diff --git a/files/templates/CHRISTMAS/login_2fa.html b/files/templates/CHRISTMAS/login_2fa.html index 7d99a790f1..95eaed33c3 100644 --- a/files/templates/CHRISTMAS/login_2fa.html +++ b/files/templates/CHRISTMAS/login_2fa.html @@ -13,7 +13,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/CHRISTMAS/settings.html b/files/templates/CHRISTMAS/settings.html index b0d4ac39e4..3e65b7341c 100644 --- a/files/templates/CHRISTMAS/settings.html +++ b/files/templates/CHRISTMAS/settings.html @@ -29,9 +29,9 @@ {% block stylesheets %} - + - + diff --git a/files/templates/CHRISTMAS/sign_up.html b/files/templates/CHRISTMAS/sign_up.html index 05408e455f..7fa42de37c 100644 --- a/files/templates/CHRISTMAS/sign_up.html +++ b/files/templates/CHRISTMAS/sign_up.html @@ -26,9 +26,9 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + - + diff --git a/files/templates/CHRISTMAS/sign_up_failed_ref.html b/files/templates/CHRISTMAS/sign_up_failed_ref.html index 877a636eef..9ae43cf570 100644 --- a/files/templates/CHRISTMAS/sign_up_failed_ref.html +++ b/files/templates/CHRISTMAS/sign_up_failed_ref.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/CHRISTMAS/tailwind.html b/files/templates/CHRISTMAS/tailwind.html index 9279047bfc..03c161c520 100644 --- a/files/templates/CHRISTMAS/tailwind.html +++ b/files/templates/CHRISTMAS/tailwind.html @@ -5,7 +5,7 @@ - + Flask + Tailwind CSS diff --git a/files/templates/authforms.html b/files/templates/authforms.html index cfbbc40bf3..3eedad6a41 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -14,11 +14,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/comments.html b/files/templates/comments.html index 74994f4b0e..167a83999f 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -300,6 +300,7 @@ {% endif %} {% endif %} diff --git a/files/templates/default.html b/files/templates/default.html index 8c0df2c6eb..f445b311ba 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -6,12 +6,12 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 191cfedef4..8c4e9a4e31 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -6,11 +6,11 @@ {% block content %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login.html b/files/templates/login.html index 4bad266f79..ce121254cc 100644 --- a/files/templates/login.html +++ b/files/templates/login.html @@ -17,7 +17,7 @@ {% endblock %} - + diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index e12271e224..57b5c3f359 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -13,7 +13,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/settings.html b/files/templates/settings.html index fb454f7771..e7517a7efc 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -33,7 +33,7 @@ - + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index 88634e1abb..d7c4845158 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -38,10 +38,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 501d5558de..d3e5373dc2 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -30,7 +30,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 7de91792dc..9d94a1f5d7 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/submit.html b/files/templates/submit.html index 14446d8c6e..8d61db95f6 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,11 +25,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} From ab25c7f8efd542f100b5f99f477511c56a7d16a3 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sat, 18 Dec 2021 21:09:52 +0200 Subject: [PATCH 16/27] dfsfsd --- files/templates/CHRISTMAS/authforms.html | 4 +- files/templates/CHRISTMAS/default.html | 4 +- files/templates/CHRISTMAS/login.html | 4 +- files/templates/CHRISTMAS/login_2fa.html | 2 +- files/templates/CHRISTMAS/settings.html | 4 +- files/templates/CHRISTMAS/sign_up.html | 4 +- .../CHRISTMAS/sign_up_failed_ref.html | 2 +- files/templates/CHRISTMAS/tailwind.html | 2 +- files/templates/authforms.html | 4 +- files/templates/comments.html | 182 ++++++++++-------- 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 +- 19 files changed, 126 insertions(+), 112 deletions(-) diff --git a/files/templates/CHRISTMAS/authforms.html b/files/templates/CHRISTMAS/authforms.html index 81f5e76ad0..9a03138d5c 100644 --- a/files/templates/CHRISTMAS/authforms.html +++ b/files/templates/CHRISTMAS/authforms.html @@ -14,11 +14,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/CHRISTMAS/default.html b/files/templates/CHRISTMAS/default.html index 0fbf3f6ef0..572ed443ac 100644 --- a/files/templates/CHRISTMAS/default.html +++ b/files/templates/CHRISTMAS/default.html @@ -186,9 +186,9 @@ {% block stylesheets %} - + - + diff --git a/files/templates/CHRISTMAS/login.html b/files/templates/CHRISTMAS/login.html index 8c20ce292f..3d9dac0fe4 100644 --- a/files/templates/CHRISTMAS/login.html +++ b/files/templates/CHRISTMAS/login.html @@ -13,9 +13,9 @@ Login - {{'SITE_NAME' | app_config}} {% endblock %} - + - + diff --git a/files/templates/CHRISTMAS/login_2fa.html b/files/templates/CHRISTMAS/login_2fa.html index 95eaed33c3..0a53cf4fdb 100644 --- a/files/templates/CHRISTMAS/login_2fa.html +++ b/files/templates/CHRISTMAS/login_2fa.html @@ -13,7 +13,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/CHRISTMAS/settings.html b/files/templates/CHRISTMAS/settings.html index 3e65b7341c..72801e4a98 100644 --- a/files/templates/CHRISTMAS/settings.html +++ b/files/templates/CHRISTMAS/settings.html @@ -29,9 +29,9 @@ {% block stylesheets %} - + - + diff --git a/files/templates/CHRISTMAS/sign_up.html b/files/templates/CHRISTMAS/sign_up.html index 7fa42de37c..f920254bf9 100644 --- a/files/templates/CHRISTMAS/sign_up.html +++ b/files/templates/CHRISTMAS/sign_up.html @@ -26,9 +26,9 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}Sign up - {{'SITE_NAME' | app_config}}{% endif %} - + - + diff --git a/files/templates/CHRISTMAS/sign_up_failed_ref.html b/files/templates/CHRISTMAS/sign_up_failed_ref.html index 9ae43cf570..691af14ebe 100644 --- a/files/templates/CHRISTMAS/sign_up_failed_ref.html +++ b/files/templates/CHRISTMAS/sign_up_failed_ref.html @@ -31,7 +31,7 @@ {% if ref_user %}{{ref_user.username}} invites you to {{'SITE_NAME' | app_config}}{% else %}{{'SITE_NAME' | app_config}}{% endif %} - + diff --git a/files/templates/CHRISTMAS/tailwind.html b/files/templates/CHRISTMAS/tailwind.html index 03c161c520..e98fef2e3c 100644 --- a/files/templates/CHRISTMAS/tailwind.html +++ b/files/templates/CHRISTMAS/tailwind.html @@ -5,7 +5,7 @@ - + Flask + Tailwind CSS diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 3eedad6a41..c939b35f01 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -14,11 +14,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/comments.html b/files/templates/comments.html index 167a83999f..c9bafdd619 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -43,25 +43,25 @@
-
+
- - posts + + posts - - comments + + comments coins - +      - View - + View + -
+
@@ -205,7 +205,7 @@ {% if c.author.verified %} {% endif %} - {{c.author.username}} + {{c.author.username}} {% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} {% if c.parent_comment_id and not standalone and level != 1 %}{{ c.parent_comment.author.username }}{% endif %} @@ -252,7 +252,7 @@
-
@@ -274,19 +274,19 @@
- +   - +   - +   - +   - +   -
{% endif %}
-
    -
  • + +
      {% if v and v.admin_level > 1 %} - - {% endif %} + + {% endif %} + +
    • + {% if v %} + + {% endif %} + + + + {% if v and request.path.startswith('/@') and v.admin_level == 0 %} + {% if voted==1 %} + + {% endif %} + {% elif v %} + + {% else %} + + {% endif %} + + + {% if v and request.path.startswith('/@') and v.admin_level == 0 %} + {% if voted==-1 %} + + {% endif %} + {% elif v %} + + {% else %} + + {% endif %} +
    • +
    + + + +
    • {% if v and request.path.startswith('/@') and v.admin_level == 0%} {% if voted==1 %} - + {% endif %} {% elif v %} - + {% else %} - + {% endif %} - {% if v and request.path.startswith('/@') and v.admin_level == 0 %} {% if voted==-1 %} -
    • +
    • {% endif %} {% elif v %} - + {% else %} - + {% endif %} - Votes + Votes {% if v %} - + - + - + - + {% endif %} - Context + Context - + {% if v %} - + {% endif %} {% if v and c.parent_submission and c.author_id==v.id %} - + {% if c.deleted_utc > 0 %} - + {% else %} - + {% endif %} {% endif %} {% if v and v.admin_level > 0 and v.id==c.author_id %} - - + + {% endif %} {% if v and not v.id==c.author_id %} - + - + - + {% endif %} {% if v and c.post and (v.admin_level > 1 or v.id == c.post.author_id) %} - + - + {% endif %} {% if v and v.admin_level > 1 %} {% if "/reported/" in request.path %} - - + + {% else %} - - + + {% endif %} {% endif %} {% if v and c.parent_submission and (c.author_id==v.id or v.admin_level > 0) %} - - + + {% endif %} {% if v and v.admin_level > 1 and v.id != c.author_id %} - - + + {% endif %} {% if v and v.admin_level > 1 and c.oauth_app %} - API App + API App {% endif %} - - - - {% if v and request.path.startswith('/@') and v.admin_level == 0 %} - {% if voted==1 %}{% endif %} - {% elif v %} - - {% else %} - - {% endif %} - - {% if v and request.path.startswith('/@') and v.admin_level == 0 %} - {% if voted==-1 %} - - {% endif %} - {% elif v %} - - {% else %} - - {% endif %} -
    +
{% endif %}
@@ -448,22 +462,22 @@
- +   - +   - +   -