From 038ae1cb75e9302595683005820c9f75353d0e20 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 23 Nov 2021 15:48:10 +0200 Subject: [PATCH] dfsdsf --- files/classes/submission.py | 6 +----- files/routes/comments.py | 5 +++++ files/routes/posts.py | 5 +++++ files/templates/authforms.html | 2 +- files/templates/default.html | 15 +++------------ files/templates/log.html | 2 +- files/templates/settings.html | 2 +- files/templates/submit.html | 2 +- 8 files changed, 18 insertions(+), 21 deletions(-) diff --git a/files/classes/submission.py b/files/classes/submission.py index 3c9ae0a1b..6b69af694 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -304,11 +304,7 @@ class Submission(Base): @lazy def realurl(self, v): - if v and v.agendaposter and random.randint(1, 10) < 4: - if site == 'rdrama.net': - return random.choice(['https://secure.actblue.com/donate/ms_blm_homepage_2019','https://rdrama.net/post/19711/a-short-guide-on-how-to']) - return 'https://secure.actblue.com/donate/ms_blm_homepage_2019' - elif v and self.url and self.url.startswith("https://old.reddit.com/"): + if v and self.url and self.url.startswith("https://old.reddit.com/"): url = self.url if v.teddit: url = self.url.replace("old.reddit.com", "teddit.net") elif not v.oldreddit: url = self.url.replace("old.reddit.com", "reddit.com") diff --git a/files/routes/comments.py b/files/routes/comments.py index 396ddaa30..cd7e22b24 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -138,6 +138,11 @@ def api_comment(v): if request.content_length > 8 * 1024 * 1024: return "Max file size is 8 MB.", 413 elif request.content_length > 4 * 1024 * 1024: return "Max file size is 4 MB.", 413 + if v.agendaposter and random.randint(1, 10) < 7: + if request.host == 'rdrama.net': + return redirect(random.choice(['https://secure.actblue.com/donate/ms_blm_homepage_2019','https://rdrama.net/post/19711/a-short-guide-on-how-to','https://secure.transequality.org/site/Donation2?df_id=1480'])) + return redirect('https://secure.actblue.com/donate/ms_blm_homepage_2019') + parent_submission = request.values.get("submission").strip() parent_fullname = request.values.get("parent_fullname").strip() diff --git a/files/routes/posts.py b/files/routes/posts.py index 58f64f8ea..010824d70 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -520,6 +520,11 @@ def submit_post(v): if request.content_length > 8 * 1024 * 1024: return "Max file size is 8 MB.", 413 elif request.content_length > 4 * 1024 * 1024: return "Max file size is 4 MB.", 413 + if v.agendaposter and random.randint(1, 10) < 7: + if request.host == 'rdrama.net': + return redirect(random.choice(['https://secure.actblue.com/donate/ms_blm_homepage_2019','https://rdrama.net/post/19711/a-short-guide-on-how-to','https://secure.transequality.org/site/Donation2?df_id=1480'])) + return redirect('https://secure.actblue.com/donate/ms_blm_homepage_2019') + title = request.values.get("title", "").strip() url = request.values.get("url", "").strip() title_html = filter_title(title) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index e5ed2991d..43f6efedc 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -16,7 +16,7 @@ {% if v %} - {% if v.agendaposter %}{% elif v.css %}{% endif %} + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} diff --git a/files/templates/default.html b/files/templates/default.html index 263677283..7c48bdeb5 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -44,18 +44,11 @@ this.random(50,300)},bug_near_window_edge:function(){this.near_edge=0;this.bug.topdocument.documentElement.clientHeight-this.options.edge_resistance&&(this.near_edge|=this.NEAR_BOTTOM_EDGE);this.bug.leftdocument.documentElement.clientWidth-this.options.edge_resistance&&(this.near_edge|=this.NEAR_RIGHT_EDGE);return this.near_edge},getPos:function(){return this.inserted&& this.bug&&this.bug.style?{top:parseInt(this.bug.top,10),left:parseInt(this.bug.left,10)}:null}},SpawnBug=function(){var a={},b;for(b in Bug)Bug.hasOwnProperty(b)&&(a[b]=Bug[b]);return a},mergeOptions=function(a,b,c){"undefined"==typeof c&&(c=!0);a=c?cloneOf(a):a;for(var d in b)b.hasOwnProperty(d)&&(a[d]=b[d]);return a},cloneOf=function(a){if(null==a||"object"!=typeof a)return a;var b=a.constructor(),c;for(c in a)a.hasOwnProperty(c)&&(b[c]=cloneOf(a[c]));return b}; window.requestAnimFrame=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(a,b){window.setTimeout(a,1E3/60)}}(); - new BugController({ - imageSprite: "/assets/images/fly-sprite.webp", - canDie: false, - minBugs: 5, - maxBugs: 30, - mouseOver: "fly" - }); new SpiderController({ imageSprite: "/assets/images/spider-sprite.webp", canDie: false, - minBugs: 2, - maxBugs: 20, + minBugs: 1, + maxBugs: 1, mouseOver: "fly" }); @@ -110,8 +103,6 @@ - @@ -256,7 +247,7 @@ - {% if v.agendaposter %}{% elif v.css %}{% endif %} + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} diff --git a/files/templates/log.html b/files/templates/log.html index d2396a860..6258c7ce7 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -18,7 +18,7 @@ {% if v %} - {% if v.agendaposter %}{% elif v.css %}{% endif %} + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} diff --git a/files/templates/settings.html b/files/templates/settings.html index 7154510b1..798ab5e25 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -56,7 +56,7 @@ - {% if v.agendaposter %}{% elif v.css %}{% endif %} + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/submit.html b/files/templates/submit.html index 098a12ee1..e8cee6bcd 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -32,7 +32,7 @@ {% if v %} - {% if v.agendaposter %}{% elif v.css %}{% endif %} + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %}