From feddf11bb79d0c46404b072b5f4c11559e233a0d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 21:06:27 +0200 Subject: [PATCH 01/11] gdgd --- files/templates/authforms.html | 1 - files/templates/award_modal.html | 152 +-------- files/templates/changelog.html | 1 + files/templates/comments.html | 364 +-------------------- files/templates/contact.html | 1 - files/templates/default.html | 157 +-------- files/templates/delete_post_modal.html | 23 +- files/templates/email/default.html | 58 ---- files/templates/emoji_modal.html | 110 +------ files/templates/expanded_image_modal.html | 5 - files/templates/formatting.html | 2 - files/templates/gif_modal.html | 142 +------- files/templates/header.html | 2 + files/templates/home.html | 12 + files/templates/home_comments.html | 1 - files/templates/login.html | 2 - files/templates/login_2fa.html | 1 - files/templates/mobile_navigation_bar.html | 53 +-- files/templates/report_post_modal.html | 52 +-- files/templates/settings.html | 30 +- files/templates/settings2.html | 13 +- files/templates/settings_apps.html | 2 - files/templates/settings_blocks.html | 1 - files/templates/settings_filters.html | 1 - files/templates/settings_profile.html | 91 +----- files/templates/settings_security.html | 25 -- files/templates/sign_up.html | 15 +- files/templates/sign_up_failed_ref.html | 1 - files/templates/submission.html | 138 +++----- files/templates/submission_banned.html | 7 - files/templates/submission_listing.html | 6 - files/templates/submit.html | 275 +--------------- files/templates/userpage.html | 135 +------- 33 files changed, 100 insertions(+), 1779 deletions(-) diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 8aa70bc7a1..eaf2ab29b4 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -106,7 +106,6 @@ - \ No newline at end of file diff --git a/files/templates/award_modal.html b/files/templates/award_modal.html index 6ff25e1855..df1bd2600d 100644 --- a/files/templates/award_modal.html +++ b/files/templates/award_modal.html @@ -1,154 +1,4 @@ - + - diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 2efafc3f0d..f1b44e60ed 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -192,6 +192,4 @@ Allowed styles: {% include "expanded_image_modal.html" %} - - {% endblock %} diff --git a/files/templates/gif_modal.html b/files/templates/gif_modal.html index a5855e48c0..e37121b426 100644 --- a/files/templates/gif_modal.html +++ b/files/templates/gif_modal.html @@ -1,144 +1,4 @@ - + -

Content Filters

diff --git a/files/templates/settings_profile.html b/files/templates/settings_profile.html index 3a3fde67fb..a7ba808004 100644 --- a/files/templates/settings_profile.html +++ b/files/templates/settings_profile.html @@ -6,6 +6,8 @@ {% include "emoji_modal.html" %} {% include "gif_modal.html" %} + +
@@ -110,7 +112,6 @@
-
@@ -138,16 +139,13 @@
@@ -156,76 +154,6 @@
-

Change the background for the website.

- -
-
{% if not v.flairchanged %} @@ -557,16 +477,12 @@

Or type a color code:

-
-
-
-
@@ -582,7 +498,6 @@
-
  @@ -599,9 +514,7 @@
-

-										
 										
Limit of 1500 characters diff --git a/files/templates/settings_security.html b/files/templates/settings_security.html index 0d6c6dd988..86aa0f77e2 100644 --- a/files/templates/settings_security.html +++ b/files/templates/settings_security.html @@ -17,20 +17,13 @@

Email

Change the email address used to sign in to your account.

-
-
-
-
- -
- {% if v.email and not v.is_activated %} @@ -38,31 +31,18 @@ {% elif not v.email %}
Add an email to secure your account in case you forget your password.
{% endif %} -
-
-
- -
- - Password required to update your email. -
-
- Password required to update your email. -
- -
-
- - diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 60d3231fc2..4ee5ec6065 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -2,16 +2,9 @@ - - - + @@ -174,7 +164,6 @@ - {% if "rdrama" in request.host %}
diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index ecccf6553e..6a0c4c1b65 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -109,7 +109,6 @@ - diff --git a/files/templates/submission.html b/files/templates/submission.html index da328d96e4..1d403fc4be 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -17,63 +17,20 @@ {% if v and v.id == p.author_id %} - -{% endif %} - -{% if v %} - + body.classList.toggle("d-none"); + title.classList.toggle("d-none"); + form.classList.toggle("d-none"); + autoExpand(box); + }; + {% endif %} +{% if p.award_count("shit") %} + + {% set minbugs = 10*p.award_count("shit") if p.award_count("shit") < 3 else 20 %} + {% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") < 3 else 40 %} + +{% endif %} + + +{% if p.award_count("fireflies") %} + + {% set minbugs = 10*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 20 %} + {% set maxbugs = 20*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 40 %} + +{% endif %} + @@ -254,36 +242,6 @@ {% block content %} -{% if p.award_count("shit") %} - - {% set minbugs = 10*p.award_count("shit") if p.award_count("shit") < 3 else 20 %} - {% set maxbugs = 20*p.award_count("shit") if p.award_count("shit") < 3 else 40 %} - -{% endif %} - - -{% if p.award_count("fireflies") %} - - {% set minbugs = 10*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 20 %} - {% set maxbugs = 20*p.award_count("fireflies") if p.award_count("fireflies") < 3 else 40 %} - -{% endif %}
@@ -325,11 +283,9 @@  {{p.age_string}} ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) - {% if p.edited_utc %}  Edited {{p.edited_string}}{% endif %}   {{p.views}} views
- {% if p.active_flags %}
Reported by: @@ -343,7 +299,6 @@
{% endif %} - {% if p.realurl(v) %}

{% if p.club %}COUNTRY CLUB{% endif %} @@ -361,7 +316,6 @@ {% if "streamable.com/" in p.realurl(v) %}

-								
 							{% elif "spotify.com/" in p.realurl(v) %}
 								{% if "spotify.com/embed/" in p.realurl(v) %}
 									{% set streamurl=p.realurl(v) %}
@@ -380,7 +334,6 @@
 								
{% endif %} {% endif %} -
{% if p.is_image %}
@@ -445,7 +398,6 @@
{% endif %} -
    @@ -460,7 +412,6 @@ {% endif %}
  • Votes
  • - {% if v and v.id!=p.author_id %}
  • Give Award
  • {% endif %} @@ -488,7 +439,6 @@
  • Delete
  • {% endif %} {% endif %} - {% if v and v.admin_level>=3 %}
  • Pin
  • Unpin
  • @@ -538,7 +488,6 @@
  • Unban user
  • {% endif %} {% endif %} -
@@ -553,7 +502,6 @@
{{score}} -
diff --git a/files/templates/submission_banned.html b/files/templates/submission_banned.html index 9844bf7ae7..5009a9a7e7 100644 --- a/files/templates/submission_banned.html +++ b/files/templates/submission_banned.html @@ -76,7 +76,6 @@ {% if p.is_banned and p.ban_reason %}
Reason: {{p.ban_reason | safe}}
{% endif %} - {% if v and v.admin_level >=3 and p.body_html %}
{{p.body_html | safe}} @@ -117,19 +116,15 @@ {% endblock %} diff --git a/files/templates/submission_listing.html b/files/templates/submission_listing.html index f21f2b43f4..7adb91eed0 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -80,7 +80,6 @@
- {% if p.club and not (v and v.paid_dues) %} {% elif not p.url %} @@ -100,7 +99,6 @@ {% endif %} -
@@ -135,7 +133,6 @@  {{p.age_string}}   ({% if p.realurl(v) %}{{p.domain}}{% else %}text post{% endif %}) - {% if p.edited_utc %}  Edited {{p.edited_string}}{% endif %}   {{p.views}} views
@@ -183,7 +180,6 @@ {% endif %} {% endif %} - {% if v and v.admin_level>=3 %}
  • Pin
  • Unpin
  • @@ -229,7 +225,6 @@
  • Unban user
  • {% endif %} {% endif %} -

    @@ -487,7 +482,6 @@

    @{{u.username}} hasn't made a post yet

    Their posting history will show here.

    -				
     			
    diff --git a/files/templates/submit.html b/files/templates/submit.html index 0006a5c296..b61bb282a0 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -1,248 +1,11 @@ - - - + - @@ -255,7 +18,6 @@ {% block title %} Create a post - {{'SITE_NAME' | app_config}} {% endblock %} - @@ -319,12 +81,10 @@
    - - Optional if you have text. You can upload videos up to 1 minute long. @@ -338,7 +98,6 @@
    Toggle preview
    -
    @@ -371,7 +130,6 @@ -
    @@ -389,7 +147,6 @@ -
    @@ -414,38 +171,8 @@ {% endblock %} - - -
     
     
    diff --git a/files/templates/userpage.html b/files/templates/userpage.html
    index 496f4c8b8e..f8ff042c5b 100644
    --- a/files/templates/userpage.html
    +++ b/files/templates/userpage.html
    @@ -43,123 +43,7 @@
     
     {% block desktopUserBanner %}
     
    -
    +>
     
     
     
    @@ -177,7 +61,6 @@
    BANNED USER{% if u.ban_reason %}: {{u.ban_reason}}{% endif %}
    {% if u.unban_utc %}
    {{u.unban_string}}
    {% endif %} {% endif %} -

    {{u.username}}

    {% if u.username != u.original_username %} @@ -224,14 +107,11 @@
    {% if u.customtitle %}

    {% if u.quadrant %}{% endif %}{{u.customtitle | safe}}

    {% endif %} -
    {{u.coins}} -     {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %} - joined {{u.created_date}}
    {% if "pcm" in request.host %}

    Based Count: {{u.basedcount}}

    {% endif %} @@ -261,7 +141,6 @@ {% if v and v.id != u.id %} {% if u.id != 995 %}Unfollow{% endif %} Follow - Message Get them help @@ -370,7 +249,6 @@ {% endif %} -
    
     
     						
    @@ -378,7 +256,6 @@
    - Disable Agendaposter Theme
    
    @@ -471,7 +348,6 @@
     				{% endif %}
     				{% if u.verified %} {% endif %}
     				

    {{u.username}}

    - {% if u.username != u.original_username %} @@ -494,9 +370,7 @@ {{u.coins}}     - {% if u.stored_subscriber_count >=1 and not u.is_nofollow %}{{u.stored_subscriber_count}} follower{{'s' if u.stored_subscriber_count != 1 else ''}}   {% endif %} - {% if "pcm" in request.host %}
    Based count: {{u.basedcount}} {% endif %} @@ -535,7 +409,6 @@ {% if v and v.id != u.id %} {% if u.id != 995 %}Unfollow{% endif %} Follow - Message Get them help Gift {{'COINS_NAME' | app_config}} @@ -592,10 +465,8 @@
    {{u.username}} will receive 0 {{'COINS_NAME' | app_config}}
    - {% if v.admin_level > 1 %} - @@ -649,7 +520,6 @@ {% endif %} -
    
     
     						
    @@ -657,7 +527,6 @@
    - Disable Agendaposter Theme
    
    @@ -703,9 +572,7 @@
     				{% if u.is_suspended %}
     					

    Banned by: @{{u.banned_by.username}}

    {% endif %} - - From a8074a795a605830bfb0f9db2bc922ad2990e3e7 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 21:18:44 +0200 Subject: [PATCH 03/11] fds --- files/templates/comments.html | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index cde688b77c..624dd4e7f2 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -176,8 +176,11 @@ {% if c.author.verified %} {% endif %} - {{c.author.username}}{% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} + {{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<=7 %}{{ c.parent_comment.author.username }}{% endif %} +  {{c.age_string}} {% if c.edited_utc %} · Edited {{c.edited_string}} From 6ee3e46071fbae42a2fd96df54e7085bb7b60ea1 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 21:24:31 +0200 Subject: [PATCH 04/11] fds --- files/templates/comments.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 624dd4e7f2..86f13a282f 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -178,9 +178,9 @@ {{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<=7 %}{{ c.parent_comment.author.username }}{% endif %} + {% if c.parent_comment and c.parent_comment.parent_comment_id and not standalone and level<=7 %}{{ c.parent_comment.author.username }}{% endif %} + -  {{c.age_string}} {% if c.edited_utc %} · Edited {{c.edited_string}} From 730b6222393eea1d605679f4c5d6d44a721973b5 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 21:24:46 +0200 Subject: [PATCH 05/11] fg --- files/templates/comments.html | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 86f13a282f..9a61adbc63 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -178,8 +178,7 @@ {{c.author.username}} {% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %} - {% if c.parent_comment and c.parent_comment.parent_comment_id and not standalone and level<=7 %}{{ c.parent_comment.author.username }}{% endif %} - + {% if c.parent_comment_id and not standalone and level<=7 %}{{ c.parent_comment.author.username }}{% endif %}  {{c.age_string}} {% if c.edited_utc %} From 1600373e37955eb73b76c7f1a7df242c116af8f4 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 22:08:58 +0200 Subject: [PATCH 06/11] sfd --- files/routes/discord.py | 2 +- files/templates/sign_up.html | 54 +----------------------------------- 2 files changed, 2 insertions(+), 54 deletions(-) diff --git a/files/routes/discord.py b/files/routes/discord.py index b7cfbd4f67..4a396a7f35 100644 --- a/files/routes/discord.py +++ b/files/routes/discord.py @@ -17,7 +17,7 @@ def join_discord(v): if v.is_suspended != 0: return "You're banned" - if 'rdrama' in request.host and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150: return f"You must earn 150 {COINS_NAME} before entering the Discord server. You earn {COINS_NAME} by making posts/comments and getting upvoted." + if 'rdrama' in request.host and v.admin_level == 0 and v.patron == 0 and v.coins < 150: return f"You must earn 150 {COINS_NAME} before entering the Discord server. You earn {COINS_NAME} by making posts/comments and getting upvoted." if v.shadowbanned or v.agendaposter: return "" diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 4ee5ec6065..dab138aa7a 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -4,59 +4,7 @@ - + From 95cab8f61423dc421dd06360d561018a6a3a6b6a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 22:09:13 +0200 Subject: [PATCH 07/11] fds --- files/routes/discord.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/files/routes/discord.py b/files/routes/discord.py index 4a396a7f35..b7cfbd4f67 100644 --- a/files/routes/discord.py +++ b/files/routes/discord.py @@ -17,7 +17,7 @@ def join_discord(v): if v.is_suspended != 0: return "You're banned" - if 'rdrama' in request.host and v.admin_level == 0 and v.patron == 0 and v.coins < 150: return f"You must earn 150 {COINS_NAME} before entering the Discord server. You earn {COINS_NAME} by making posts/comments and getting upvoted." + if 'rdrama' in request.host and v.admin_level == 0 and v.patron == 0 and v.truecoins < 150: return f"You must earn 150 {COINS_NAME} before entering the Discord server. You earn {COINS_NAME} by making posts/comments and getting upvoted." if v.shadowbanned or v.agendaposter: return "" From 3d641c08d86e98c73d66bd1800f040a291802b3a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 22:20:06 +0200 Subject: [PATCH 09/11] sdf --- files/templates/comments.html | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index 9a61adbc63..e1bcadd316 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -1,5 +1,21 @@ + + {% if v %} {% endif %} @@ -142,7 +158,7 @@ {% endif %} -
    +
    From b66b7ea56f3c797d58a5c2a7907a7c9fbe4bc662 Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 22:24:34 +0200 Subject: [PATCH 10/11] fgd --- files/templates/comments.html | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/files/templates/comments.html b/files/templates/comments.html index e1bcadd316..cde688b77c 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -1,21 +1,5 @@ - - {% if v %} {% endif %} @@ -158,7 +142,7 @@
    {% endif %} -
    +
    @@ -192,9 +176,7 @@ {% if c.author.verified %} {% endif %} - {{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<=7 %}{{ c.parent_comment.author.username }}{% endif %} + {{c.author.username}}{% if c.author.customtitle %}  {% if c.author.quadrant %}{% endif %}{{c.author.customtitle | safe}}{% endif %}  {{c.age_string}} {% if c.edited_utc %} From dcd93cf03e6777beefdc9de841e3ed3403d4855d Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Mon, 27 Sep 2021 22:26:34 +0200 Subject: [PATCH 11/11] g --- files/routes/awards.py | 2 +- files/routes/posts.py | 21 +++++---------------- 2 files changed, 6 insertions(+), 17 deletions(-) diff --git a/files/routes/awards.py b/files/routes/awards.py index 8b0c41bf57..51b6f4fe20 100644 --- a/files/routes/awards.py +++ b/files/routes/awards.py @@ -244,7 +244,7 @@ def award_post(pid, v): g.db.add(post.author) g.db.commit() - if request.referrer: return redirect(request.referrer) + if len(request.referrer) > 1: return redirect(request.referrer) else: return redirect("/") diff --git a/files/routes/posts.py b/files/routes/posts.py index 9348c02878..6630d7d5ca 100644 --- a/files/routes/posts.py +++ b/files/routes/posts.py @@ -370,29 +370,18 @@ def edit_post(pid, v): def get_post_title(v): url = request.values.get("url", None) - if not url: - return abort(400) + if not url: return abort(400) #mimic chrome browser agent headers = {"User-Agent": f"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.72 Safari/537.36"} - try: - x = requests.get(url, headers=headers) - except BaseException: - return {"error": "Could not reach page"}, 400 - - - if not x.status_code == 200: - return {"error": f"Page returned {x.status_code}"}, x.status_code + try: x = requests.get(url, headers=headers) + except BaseException: return {"error": "Could not reach page"}, 400 + if not x.status_code == 200: return {"error": f"Page returned {x.status_code}"}, x.status_code try: soup = BeautifulSoup(x.content, 'html.parser') - - data = {"url": url, - "title": soup.find('title').string - } - - return data + return {"url": url, "title": soup.find('title').string} except BaseException: return {"error": f"Could not find a title"}, 400