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 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..dab138aa7a 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -2,72 +2,10 @@ - - - - - document.getElementById('password-register').addEventListener('input', function () { - - var charCount = document.getElementById("password-register").value; - var id = document.getElementById("passwordHelpRegister"); - var successID = document.getElementById("passwordHelpSuccess"); - - if (charCount.length >= 8) { - id.classList.add("d-none"); - successID.classList.remove("d-none"); - } - else { - id.classList.remove("d-none"); - successID.classList.add("d-none"); - }; - - }); - - // Check username length, special chars - - document.getElementById('username-register').addEventListener('input', function () { - - var charCount = document.getElementById("username-register").value; - var id = document.getElementById("usernameHelpRegister"); - var successID = document.getElementById("usernameHelpSuccess"); - - var API = '/is_available/' + charCount; - - if (charCount.length >= 3) { - - $.getJSON(API, function(result) { - $.each(result, function(i, field) { - if (field == false) { - id.innerHTML = 'Username already taken :('; - } - }); - }); - - } - - if (!/[^a-zA-Z0-9_\-$]/.test(charCount)) { - // Change alert text - id.innerHTML = 'Username is a-okay!'; - - if (charCount.length < 3) { - id.innerHTML = 'Username must be at least 3 characters long.'; - } - else if (charCount.length > 25) { - id.innerHTML = 'Username must be 25 characters or less.'; - } - } - else { - id.innerHTML = 'No special characters or spaces allowed.'; - }; - - }); - @@ -174,7 +112,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 4325c6245d..c6263aa0e3 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -17,65 +17,60 @@ {% if v and v.id == p.author_id %} - + body.classList.toggle("d-none"); + title.classList.toggle("d-none"); + form.classList.toggle("d-none"); + autoExpand(box); + }; + {% endif %} -{% if v %} + +{% 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 %} @@ -247,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 %}
@@ -317,12 +282,10 @@ {{p.author.username}}{% if p.author.customtitle %}  {% if p.author.quadrant %}{% endif %}{{p.author.customtitle | safe}}{% endif %}  {{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: @@ -336,7 +299,6 @@
{% endif %} - {% if p.realurl(v) %}

{% if p.club %}COUNTRY CLUB{% endif %} @@ -354,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) %}
@@ -373,7 +334,6 @@
 								
{% endif %} {% endif %} -
{% if p.is_image %}
@@ -438,7 +398,6 @@
{% endif %} -
    @@ -458,7 +417,6 @@ {% endif %}
  • Votes
  • - {% if v and v.id!=p.author_id %}
  • Give Award
  • {% endif %} @@ -486,7 +444,6 @@
  • Delete
  • {% endif %} {% endif %} - {% if v and v.admin_level>=3 %}
  • Pin
  • Unpin
  • @@ -536,7 +493,6 @@
  • Unban user
  • {% endif %} {% endif %} -
@@ -551,7 +507,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 76b6c66203..365d203a2e 100644 --- a/files/templates/submission_listing.html +++ b/files/templates/submission_listing.html @@ -71,7 +71,6 @@
- {% if p.club and not (v and v.paid_dues) %} {% elif not p.url %} @@ -91,7 +90,6 @@ {% endif %} -
@@ -126,7 +124,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
@@ -178,7 +175,6 @@ {% endif %} {% endif %} - {% if v and v.admin_level>=3 %}
  • Pin
  • Unpin
  • @@ -224,7 +220,6 @@
  • Unban user
  • {% endif %} {% endif %} -

    @@ -501,7 +496,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 %} - -