diff --git a/docker-compose.yml b/docker-compose.yml index ad835c98e4..0830e86cb8 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -37,6 +37,8 @@ services: - READ_ONLY=0 - BOT_DISABLE=0 - COINS_NAME=Dramacoins + - DEFAULT_THEME=dark + - DEFAULT_COLOR=ff66ac links: - "redis" - "postgres" diff --git a/files/__main__.py b/files/__main__.py index 277ebb99c7..712b11a9c2 100644 --- a/files/__main__.py +++ b/files/__main__.py @@ -36,7 +36,7 @@ app.config['DATABASE_URL'] = environ.get("DATABASE_CONNECTION_POOL_URL",environ. app.config['SECRET_KEY'] = environ.get('MASTER_KEY') app.config["SERVER_NAME"] = environ.get("DOMAIN").strip() -app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 31536000 +app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 86400 app.config["SESSION_COOKIE_NAME"] = "session_" + environ.get("SITE_NAME").strip().lower() app.config["VERSION"] = "1.0.0" @@ -47,6 +47,8 @@ app.config["SESSION_COOKIE_SAMESITE"] = "Lax" app.config["PERMANENT_SESSION_LIFETIME"] = 60 * 60 * 24 * 365 app.config["SESSION_REFRESH_EACH_REQUEST"] = True +app.config["DEFAULT_THEME"] = environ.get("defaulttheme").strip() + "_" + environ.get("defaultcolor").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.jinja_env.cache = {} diff --git a/files/classes/comment.py b/files/classes/comment.py index 164105278d..43d261d605 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -246,7 +246,7 @@ class Comment(Base, Age_times, Scores, Stndrd, Fuzzing): def realbody(self, v): body = self.comment_aux.body_html - if not v or v.slurreplacer: body = body.replace(" nigger"," πŸ€").replace(" Nigger"," πŸ€").replace(" NIGGER"," πŸ€").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," πŸš„").replace(" Tranny"," πŸš„").replace(" TRANNY"," πŸš„").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" trump"," DDR").replace(" Trump"," DDR").replace(" TRUMP"," DDR").replace(" biden"," DDD").replace(" Biden"," DDD").replace(" BIDEN"," DDD").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," πŸš„").replace(" Trannie"," πŸš„").replace(" TRANNIE"," πŸš„").replace(" troon"," πŸš„").replace(" Troon"," πŸš„").replace(" TROON"," πŸš„") + if not v or v.slurreplacer: body = body.replace(" nigger"," πŸ€").replace(" Nigger"," πŸ€").replace(" NIGGER"," πŸ€").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," πŸš„").replace(" Tranny"," πŸš„").replace(" TRANNY"," πŸš„").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," πŸš„").replace(" Trannie"," πŸš„").replace(" TRANNIE"," πŸš„").replace(" troon"," πŸš„").replace(" Troon"," πŸš„").replace(" TROON"," πŸš„") if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com") if v and v.controversial: diff --git a/files/classes/images.py b/files/classes/images.py index 9f635cc10b..9b13187635 100644 --- a/files/classes/images.py +++ b/files/classes/images.py @@ -1,7 +1,9 @@ from sqlalchemy import * from flask import g from files.__main__ import Base +from os import environ +site = environ.get("DOMAIN").strip() class Image(Base): __tablename__ = "images" @@ -11,9 +13,9 @@ class Image(Base): text = Column(String(64)) deletehash = Column(String(64)) + @property - def path(self): - return f"/assets/images/cover.png" + def path(self): return f"/assets/images/{site}/cover.png" diff --git a/files/classes/submission.py b/files/classes/submission.py index 6b9b160ee3..20bbe318b6 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -203,7 +203,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): @lazy def thumb_url(self): if self.over_18: return f"https://{site}/assets/images/nsfw.png" - elif not self.url: return f"https://{site}/assets/images/default_thumb_text.png" + elif not self.url: return f"https://{site}/assets/images/{site}/default_thumb_text.png" elif self.thumburl: return self.thumburl elif "youtu.be" in self.domain or "youtube.com" in self.domain: return f"https://{site}/assets/images/default_thumb_yt.png" else: return f"https://{site}/assets/images/default_thumb_link.png" @@ -341,7 +341,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): def realbody(self, v): body = self.submission_aux.body_html - if not v or v.slurreplacer: body = body.replace(" nigger"," πŸ€").replace(" Nigger"," πŸ€").replace(" NIGGER"," πŸ€").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," πŸš„").replace(" Tranny"," πŸš„").replace(" TRANNY"," πŸš„").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" trump"," DDR").replace(" Trump"," DDR").replace(" TRUMP"," DDR").replace(" biden"," DDD").replace(" Biden"," DDD").replace(" BIDEN"," DDD").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," πŸš„").replace(" Trannie"," πŸš„").replace(" TRANNIE"," πŸš„").replace(" troon"," πŸš„").replace(" Troon"," πŸš„").replace(" TROON"," πŸš„") + if not v or v.slurreplacer: body = body.replace(" nigger"," πŸ€").replace(" Nigger"," πŸ€").replace(" NIGGER"," πŸ€").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," πŸš„").replace(" Tranny"," πŸš„").replace(" TRANNY"," πŸš„").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," πŸš„").replace(" Trannie"," πŸš„").replace(" TRANNIE"," πŸš„").replace(" troon"," πŸš„").replace(" Troon"," πŸš„").replace(" TROON"," πŸš„") if v and not v.oldreddit: body = body.replace("old.reddit.com", "reddit.com") return body @@ -357,7 +357,7 @@ class Submission(Base, Stndrd, Age_times, Scores, Fuzzing): def realtitle(self, v): if self.title_html: title = self.title_html else: title = self.title - if not v or v.slurreplacer: title = title.replace(" nigger"," πŸ€").replace(" Nigger"," πŸ€").replace(" NIGGER"," πŸ€").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," πŸš„").replace(" Tranny"," πŸš„").replace(" TRANNY"," πŸš„").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" trump"," DDR").replace(" Trump"," DDR").replace(" TRUMP"," DDR").replace(" biden"," DDD").replace(" Biden"," DDD").replace(" BIDEN"," DDD").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," πŸš„").replace(" Trannie"," πŸš„").replace(" TRANNIE"," πŸš„").replace(" troon"," πŸš„").replace(" Troon"," πŸš„").replace(" TROON"," πŸš„") + if not v or v.slurreplacer: title = title.replace(" nigger"," πŸ€").replace(" Nigger"," πŸ€").replace(" NIGGER"," πŸ€").replace(" pedo"," libertarian").replace(" Pedo"," Libertarian ").replace(" PEDO"," LIBERTARIAN ").replace(" tranny"," πŸš„").replace(" Tranny"," πŸš„").replace(" TRANNY"," πŸš„").replace(" fag"," cute twink").replace(" Fag"," Cute twink").replace(" FAG"," CUTE TWINK").replace(" faggot"," cute twink").replace(" Faggot"," Cute twink").replace(" FAGGOT"," CUTE TWINK").replace(" steve akins"," penny verity oaken").replace(" Steve Akins"," Penny Verity Oaken").replace(" STEVE AKINS"," PENNY VERITY OAKEN").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" RETARD"," RSLUR").replace(" rapist"," male feminist").replace(" Rapist"," Male feminist").replace(" RAPIST"," MALE FEMINIST").replace(" kill yourself"," keep yourself safe").replace(" KILL YOURSELF"," KEEP YOURSELF SAFE").replace(" trannie"," πŸš„").replace(" Trannie"," πŸš„").replace(" TRANNIE"," πŸš„").replace(" troon"," πŸš„").replace(" Troon"," πŸš„").replace(" TROON"," πŸš„") return title @property diff --git a/files/classes/user.py b/files/classes/user.py index 050666f918..66db266326 100644 --- a/files/classes/user.py +++ b/files/classes/user.py @@ -16,18 +16,19 @@ from files.__main__ import Base, cache from files.helpers.security import * site = environ.get("DOMAIN").strip() - +defaulttheme = environ.get("DEFAULT_COLOR").strip() +defaultcolor = environ.get("DEFAULT_COLOR").strip() class User(Base, Stndrd, Age_times): __tablename__ = "users" id = Column(Integer, primary_key=True) username = Column(String) - namecolor = Column(String, default='ff66ac') + namecolor = Column(String, default=defaultcolor) background = Column(String) customtitle = Column(String) customtitleplain = Column(String) - titlecolor = Column(String, default='ff66ac') - theme = Column(String, default='dark') - themecolor = Column(String, default='ff66ac') + titlecolor = Column(String, default=defaultcolor) + theme = Column(String, default=defaulttheme) + themecolor = Column(String, default=defaultcolor) song = Column(String) highres = Column(String) profileurl = Column(String) diff --git a/files/routes/comments.py b/files/routes/comments.py index 69051b6089..4661c1d9e1 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -158,7 +158,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|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n").replace("\n\n\n", "\n\n") with CustomRenderer(post_id=parent_id) as renderer: body_md = renderer.render(mistletoe.Document(body)) body_html = sanitize(body_md, linkgen=True) @@ -535,7 +535,7 @@ def edit_comment(cid, v): if c.is_banned or c.deleted_utc > 0: abort(403) body = request.form.get("body", "")[:10000] - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') body = body.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n").replace("\n\n\n", "\n\n") with CustomRenderer(post_id=c.post.id) as renderer: body_md = renderer.render(mistletoe.Document(body)) body_html = sanitize(body_md, linkgen=True) diff --git a/files/routes/posts.py b/files/routes/posts.py index 977625c5d3..718981975f 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -236,7 +236,7 @@ def edit_post(pid, v): abort(403) body = request.form.get("body", "") - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') with CustomRenderer() as renderer: body_md = renderer.render(mistletoe.Document(body)) body_html = sanitize(body_md, linkgen=True) @@ -707,7 +707,7 @@ def submit_post(v): else: return render_template("submit.html", v=v, error="2048 character limit for URLs.", title=title, url=url,body=request.form.get("body", "")), 400 # render text - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', body, re.MULTILINE): body = body.replace(i.group(1), f'![]({i.group(1)})') with CustomRenderer() as renderer: body_md = renderer.render(mistletoe.Document(body)) body_html = sanitize(body_md, linkgen=True) diff --git a/files/routes/settings.py b/files/routes/settings.py index 538ea66637..caecc8239f 100644 --- a/files/routes/settings.py +++ b/files/routes/settings.py @@ -76,7 +76,7 @@ def settings_profile_post(v): v=v, error="You didn't change anything") - for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF))', bio, re.MULTILINE): bio = bio.replace(i.group(1), f'![]({i.group(1)})') + for i in re.finditer('^(https:\/\/.*\.(png|jpg|jpeg|gif|PNG|JPG|JPEG|GIF|?maxwidth=9999))', bio, re.MULTILINE): bio = bio.replace(i.group(1), f'![]({i.group(1)})') bio = bio.replace("\n", "\n\n").replace("\n\n\n\n\n\n", "\n\n").replace("\n\n\n\n", "\n\n").replace("\n\n\n", "\n\n") with CustomRenderer() as renderer: bio_html = renderer.render(mistletoe.Document(bio)) bio_html = sanitize(bio_html, linkgen=True) diff --git a/files/routes/static.py b/files/routes/static.py index 0440088204..b0ae3f9a95 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -97,7 +97,7 @@ def index(): @app.get("/assets/favicon.ico") def favicon(): - return send_file("./assets/images/favicon.png") + return send_file(f"./assets/images/{site}/favicon.png") @app.get("/api") @auth_desired diff --git a/files/routes/votes.py b/files/routes/votes.py index 0f39ae2394..c2fb49e1db 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -71,6 +71,8 @@ def api_vote_post(post_id, new, v): # check for existing vote existing = g.db.query(Vote).filter_by(user_id=v.id, submission_id=post.id).first() + if existing.vote_type == new: return "", 204 + if existing: if existing.vote_type == 0 and new != 0: post.author.coins += 1 @@ -119,6 +121,8 @@ def api_vote_comment(comment_id, new, v): # check for existing vote existing = g.db.query(CommentVote).filter_by(user_id=v.id, comment_id=comment.id).first() + if existing.vote_type == new: return "", 204 + if existing: if existing.vote_type == 0 and new != 0: comment.author.coins += 1 @@ -145,4 +149,4 @@ def api_vote_comment(comment_id, new, v): comment.upvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, vote_type=1).count() comment.downvotes = g.db.query(CommentVote).filter_by(comment_id=comment.id, vote_type=-1).count() g.db.add(comment) - return make_response(""), 204 \ No newline at end of file + return "", 204 \ No newline at end of file diff --git a/files/templates/2fa_modal.html b/files/templates/2fa_modal.html index dd6a99a620..669eac2a4a 100644 --- a/files/templates/2fa_modal.html +++ b/files/templates/2fa_modal.html @@ -24,7 +24,7 @@
Or enter this code: {{mfa_secret}}

- Step 2: Enter the six-digit code generated in the authenticator app and your {{"SITE_NAME" | app_config}} account password. + Step 2: Enter the six-digit code generated in the authenticator app and your {{'SITE_NAME' | app_config}} account password.

@@ -47,7 +47,7 @@ diff --git a/files/templates/admin/admin_home.html b/files/templates/admin/admin_home.html index ff0bd6798f..af3600056c 100644 --- a/files/templates/admin/admin_home.html +++ b/files/templates/admin/admin_home.html @@ -1,8 +1,8 @@ {% extends "default.html" %} {% block title %} -{{"SITE_NAME" | app_config}} - +{{'SITE_NAME' | app_config}} + {% endblock %} {% block content %} diff --git a/files/templates/admin/alt_votes.html b/files/templates/admin/alt_votes.html index f3fac13dde..04de672ca5 100644 --- a/files/templates/admin/alt_votes.html +++ b/files/templates/admin/alt_votes.html @@ -1,8 +1,8 @@ {% extends "default.html" %} {% block title %} -{{"SITE_NAME" | app_config}} - +{{'SITE_NAME' | app_config}} + {% endblock %} {% block content %} diff --git a/files/templates/admin/app.html b/files/templates/admin/app.html index 07eb42f468..a4bf4106ae 100644 --- a/files/templates/admin/app.html +++ b/files/templates/admin/app.html @@ -2,7 +2,7 @@ {% block title %} API App Administration - + {% endblock %} {% block content %} diff --git a/files/templates/admin/apps.html b/files/templates/admin/apps.html index 47cc0e1816..69bb7c40fa 100644 --- a/files/templates/admin/apps.html +++ b/files/templates/admin/apps.html @@ -2,7 +2,7 @@ {% block title %} API App Administration - + {% endblock %} {% block content %} diff --git a/files/templates/admin/content_stats.html b/files/templates/admin/content_stats.html index af11e57eb4..4485750c26 100644 --- a/files/templates/admin/content_stats.html +++ b/files/templates/admin/content_stats.html @@ -1,8 +1,8 @@ {% extends "default.html" %} {% block title %} -{{"SITE_NAME" | app_config}} - +{{'SITE_NAME' | app_config}} + {% endblock %} {% block content %} diff --git a/files/templates/admin/flagged_posts.html b/files/templates/admin/flagged_posts.html index 7c5040fa6b..4383173030 100644 --- a/files/templates/admin/flagged_posts.html +++ b/files/templates/admin/flagged_posts.html @@ -64,7 +64,7 @@ {% block title %} Flagged Posts - + {% endblock %} {% block content %} diff --git a/files/templates/admin/image_posts.html b/files/templates/admin/image_posts.html index f633ad0ab7..9ed678ab9f 100644 --- a/files/templates/admin/image_posts.html +++ b/files/templates/admin/image_posts.html @@ -36,7 +36,7 @@ {% block title %} Image feed - + {% endblock %} diff --git a/files/templates/admin/removed_posts.html b/files/templates/admin/removed_posts.html index 62eb6b4495..e26a52abe1 100644 --- a/files/templates/admin/removed_posts.html +++ b/files/templates/admin/removed_posts.html @@ -3,7 +3,7 @@ {% block title %} Removed Content - + {% endblock %} {% block content %} diff --git a/files/templates/api.html b/files/templates/api.html index c97a27236d..0afe5febeb 100644 --- a/files/templates/api.html +++ b/files/templates/api.html @@ -1,8 +1,8 @@ {% extends "default.html" %} {% block title %} -{{"SITE_NAME" | app_config}} - API - +{{'SITE_NAME' | app_config}} - API + {% endblock %} {% block content %} @@ -20,7 +20,7 @@ This page explains how to obtain and use an access token. ## Step 1: Create your Application -In the [apps tab of {{"SITE_NAME" | app_config}} settings](/settings/apps), fill in and submit the form to request an access token. You will need: +In the [apps tab of {{'SITE_NAME' | app_config}} settings](/settings/apps), fill in and submit the form to request an access token. You will need: * an application name * a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead). @@ -28,13 +28,13 @@ In the [apps tab of {{"SITE_NAME" | app_config}} settings](/settings/apps), fill Don't worry too much about accuracy; you will be able to change all of these later. -{{"SITE_NAME" | app_config}} administrators will review and approve or deny your request for an access token. You'll know when your request has been approved when you get a private message with an access token tied to your account. +{{'SITE_NAME' | app_config}} administrators will review and approve or deny your request for an access token. You'll know when your request has been approved when you get a private message with an access token tied to your account. DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret! ## Step 2: Using the Access Token -To use the access token, include the following header in subsequent API requests to {{"SITE_NAME" | app_config}}: `Authorization: access_token_goes_here` +To use the access token, include the following header in subsequent API requests to {{'SITE_NAME' | app_config}}: `Authorization: access_token_goes_here` Python example: @@ -73,13 +73,13 @@ The expected result of this would be a large JSON representation of the posts po
 
-The OAuth2 authorization flow is used to enable users to authorize third-party applications to access their {{"SITE_NAME" | app_config}} account without having to provide their login information to the application. +The OAuth2 authorization flow is used to enable users to authorize third-party applications to access their {{'SITE_NAME' | app_config}} account without having to provide their login information to the application. This page explains how to obtain API application keys, how to prompt a user for authorization, and how to obtain and use access tokens. ## Step 1: Create your Application -In the [apps tab of {{"SITE_NAME" | app_config}} settings](/settings/apps), fill in and submit the form to request new API keys. You will need: +In the [apps tab of {{'SITE_NAME' | app_config}} settings](/settings/apps), fill in and submit the form to request new API keys. You will need: * an application name * a Redirect URI. May not use HTTP unless using localhost (use HTTPS instead). @@ -87,7 +87,7 @@ In the [apps tab of {{"SITE_NAME" | app_config}} settings](/settings/apps), fill Don't worry too much about accuracy; you will be able to change all of these later. -{{"SITE_NAME" | app_config}} administrators will review and approve or deny your request for API keys. You'll know when your request has been approved when you get a private message with an access token tied to your account. +{{'SITE_NAME' | app_config}} administrators will review and approve or deny your request for API keys. You'll know when your request has been approved when you get a private message with an access token tied to your account. DO NOT reveal your Client ID or Access Token. Anyone with these information will be able to pretend to be you. You are responsible for keeping them a secret! @@ -95,15 +95,15 @@ DO NOT reveal your Client ID or Access Token. Anyone with these information will Send your user to `{{request.host_url}}authorize/?client_id=YOUR_CLIENT_ID` -If done correctly, the user will see that your application wants to access their {{"SITE_NAME" | app_config}} account, and be prompted to approve or deny the request. +If done correctly, the user will see that your application wants to access their {{'SITE_NAME' | app_config}} account, and be prompted to approve or deny the request. ## Step 3: Catch the redirect -The user clicks "Authorize". {{"SITE_NAME" | app_config}} will redirect the user's browser to GET the designated redirect URI. The access token URL parameter will be included in the redirect, which your server should process. +The user clicks "Authorize". {{'SITE_NAME' | app_config}} will redirect the user's browser to GET the designated redirect URI. The access token URL parameter will be included in the redirect, which your server should process. ## Step 4: Using the Access Token -To use the access token, include the following header in subsequent API requests to {{"SITE_NAME" | app_config}}: `Authorization: access_token_goes_here` +To use the access token, include the following header in subsequent API requests to {{'SITE_NAME' | app_config}}: `Authorization: access_token_goes_here` Python example: diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 3a19f3da53..95a1683d08 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -5,10 +5,10 @@ - + - {% block pagetitle %}{{"SITE_NAME" | app_config}}{% endblock %} + {% block pagetitle %}{{'SITE_NAME' | app_config}}{% endblock %} @@ -23,12 +23,12 @@ integrity="sha384-L469/ELG4Bg9sDQbl0hvjMq8pOcqFgkSpwhwnslzvVVGpDjYJ6wJJyYjvG3u8XW7" crossorigin="anonymous"> - + {% if v %} {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} @@ -57,7 +57,7 @@
- {{"SITE_NAME" | app_config}} + {{'SITE_NAME' | app_config}}

{% block authtitle %}{% endblock %}

diff --git a/files/templates/badges.html b/files/templates/badges.html index 0a4c56369f..2db8919dc3 100644 --- a/files/templates/badges.html +++ b/files/templates/badges.html @@ -9,7 +9,7 @@
Badges are sorted into bronze, silver, gold, and diamond tiers, based on the relative difficulty of obtaining them.

Unlockable Badges

-
These badges are automatically granted through different kinds of activity on {{"SITE_NAME" | app_config}}.
+
These badges are automatically granted through different kinds of activity on {{'SITE_NAME' | app_config}}.

 
diff --git a/files/templates/comments.html b/files/templates/comments.html
index bdc43ca972..27e7967792 100644
--- a/files/templates/comments.html
+++ b/files/templates/comments.html
@@ -93,7 +93,7 @@
 			{{c.post.title | safe}}
 		{% endif %}
 	{% elif c.author_id==1046 or c.author_id==2360 %}
-	{{"SITE_NAME" | app_config}} Notification
+	{{'SITE_NAME' | app_config}} Notification
 	{% else %}
 	Private Message
 	{% endif %}
@@ -125,7 +125,7 @@
 				{% if c.over_18 %}+18 {% endif %}
 				{% if v and v.admin_level==6 and c.author.shadowbanned %} {% endif %}
 				{% if c.is_pinned %} {% endif %}
-				{% if c.distinguish_level %} {% endif %}
+				{% if c.distinguish_level %} {% endif %}
 				{% if c.is_op %} {% endif %}
 				{% if c.is_bot %} {% endif %}
 				{% if c.is_blocking %} {% endif %}
diff --git a/files/templates/contact.html b/files/templates/contact.html
index 4e049d9ba4..543bcd4b71 100644
--- a/files/templates/contact.html
+++ b/files/templates/contact.html
@@ -1,8 +1,8 @@
 {% extends "default.html" %}
 
 {% block title %}
-{{"SITE_NAME" | app_config}} - Contact
-
+{{'SITE_NAME' | app_config}} - Contact
+
 {% endblock %}
 
 	
@@ -31,10 +31,10 @@
 		
 		{% endif %}
 
-

Contact {{"SITE_NAME" | app_config}} Admins

+

Contact {{'SITE_NAME' | app_config}} Admins

{% if v and v.is_activated and not v.is_suspended %} -

Use this form to contact {{"SITE_NAME" | app_config}} Admins.

+

Use this form to contact {{'SITE_NAME' | app_config}} Admins.

@@ -50,7 +50,7 @@ {% elif v and v.is_suspended %} -

Your {{"SITE_NAME" | app_config}} account has been suspended. You are not permitted to use this form.

+

Your {{'SITE_NAME' | app_config}} account has been suspended. You are not permitted to use this form.

{% elif v %} diff --git a/files/templates/default.html b/files/templates/default.html index 457b1ff92b..8bfa4a6db5 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -827,17 +827,17 @@ - + - + {% block title %} - {{"SITE_NAME" | app_config}} + {{'SITE_NAME' | app_config}} - + - + @@ -845,10 +845,10 @@ - + - + {% endblock %} @@ -862,149 +862,147 @@ - - + + - - - - - + + + + + - + - - {% block stylesheets %} @@ -1012,7 +1010,7 @@ {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} @@ -1036,7 +1034,7 @@ - + {% include "header.html" %} @@ -1162,7 +1160,7 @@ {% if request.path=='/' and g.system and g.timestamp>session.get('tooltip_last_dismissed',0)+60*60*24 and (not g.system.endswith('/chrome') and not g.system.endswith('/other')) and not g.system.endswith('/webview') %}
-
+
{% endif %} diff --git a/files/templates/delete_comment_modal.html b/files/templates/delete_comment_modal.html index 32b742166f..48d375ce20 100644 --- a/files/templates/delete_comment_modal.html +++ b/files/templates/delete_comment_modal.html @@ -15,7 +15,7 @@ -

Your comment will be removed everywhere on {{"SITE_NAME" | app_config}}. This action cannot be undone.

+

Your comment will be removed everywhere on {{'SITE_NAME' | app_config}}. This action cannot be undone.

-

Please note that {{"SITE_NAME" | app_config}} will never ask you for your email, password, or two-factor token via email, text, or phone.

+

Please note that {{'SITE_NAME' | app_config}} will never ask you for your email, password, or two-factor token via email, text, or phone.