diff --git a/files/classes/comment.py b/files/classes/comment.py index 5972622d3..7c22e71f3 100644 --- a/files/classes/comment.py +++ b/files/classes/comment.py @@ -17,7 +17,6 @@ from files.helpers.sorting_and_time import * def normalize_urls_runtime(body, v): - if not v: return body if v.reddit != 'old.reddit.com': body = reddit_to_vreddit_regex.sub(rf'\1https://{v.reddit}/\2/', body) if v.nitter: @@ -252,7 +251,7 @@ class Comment(Base): if body: body = censor_slurs(body, v) body = normalize_urls_runtime(body, v) - if not v or v.controversial: + if v.controversial: captured = [] for i in controversial_regex.finditer(body): if i.group(1) in captured: continue diff --git a/files/classes/submission.py b/files/classes/submission.py index 6f895f7d5..fb54897ba 100644 --- a/files/classes/submission.py +++ b/files/classes/submission.py @@ -244,7 +244,7 @@ class Submission(Base): if url.startswith("https://old.reddit.com/r/") and '/comments/' in url and "sort=" not in url: if "?" in url: url += "&context=9" else: url += "?context=8" - if not v or v.controversial: url += "&sort=controversial" + if v.controversial: url += "&sort=controversial" elif url.startswith("https://watchpeopledie.tv/videos/"): # Semi-temporary fix for self-hosted unproxied video serving url = url.replace("https://watchpeopledie.tv/videos/", diff --git a/files/templates/comments.html b/files/templates/comments.html index 2cbe1c8d8..061ecef05 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -806,19 +806,17 @@ {% if v %} + {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION_TOOLS_VISIBLE'] %} + + {% endif %} {% endif %} - - {% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION_TOOLS_VISIBLE'] %} - - {% endif %} - {% endif %} - diff --git a/files/templates/submission.html b/files/templates/submission.html index cb1599527..082353d98 100644 --- a/files/templates/submission.html +++ b/files/templates/submission.html @@ -79,7 +79,7 @@ {% if not p.is_image and p.thumb_url and not p.embed_url %}
- Unable to load image + Unable to load image
{% endif %} @@ -157,7 +157,7 @@ {% endif %} {% endif %}  {{p.age_string}} - ({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}{{p.domain|truncate(50, True)}}{% else %}text post{% endif %}) + ({% if p.is_image %}image post{% elif p.is_video %}video post{% elif p.is_audio %}audio post{% elif p.domain %}{{p.domain|truncate(50, True)}}{% else %}text post{% endif %}) {% if p.edited_utc %} Edited {{p.edited_string}} @@ -176,7 +176,7 @@ {% endif %} {% if p.realurl(v) and not v_forbid_deleted %}

- + {% if p.club %}{{CC}}{% endif %} {% if p.flair %}{{p.flair | safe}}{% endif %} {{p.realtitle(v) | safe}} @@ -194,7 +194,7 @@
{% if p.realurl(v) %} {% if not p.embed_url and not p.is_image %} - +
{{p.realurl(v)}} @@ -222,7 +222,7 @@ {% if p.is_image %}
@@ -542,35 +542,27 @@
-{% if v and v.id==p.author_id %} - {% include "modals/delete_post.html" %} -{% endif %} - {% if v %} + {% include "modals/delete_post.html" if v.id == p.author_id %} {% include "modals/report_post.html" %} + {% if v.id == p.author_id or v.admin_level >= PERMS['POST_EDITING'] %} + + {% endif %} + {% if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} + + {% endif %} {% endif %} -{% if v and (v.id == p.author_id or v.admin_level >= PERMS['POST_EDITING']) %} - -{% endif %} - -{% if not v or v.highlightcomments %} +{% if v.highlightcomments %} {% endif %} -{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} - -{% endif %} - +{% include "comments.html" if not p.replies %} -{% if not p.replies %} - {% include "comments.html" %} -{% endif %} - +{% if v.highlightcomments %} +{% endif %} {% if success %} {% endif %} -{% if v and v.admin_level > 1 %} +{% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} {% endif %} @@ -98,7 +98,7 @@ post thumnail {% else %} - + post thumnail @@ -305,13 +305,13 @@
{% endif %} +{% if v.highlightcomments %} +{% endif %} {% if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] %} @@ -326,22 +326,22 @@
{% endif %} - {% if p.is_image and not p.over_18 and ((v and v.cardview) or (not v and CARD_VIEW)) %} + {% if p.is_image and not p.over_18 and v.cardview %}
Unable to load image
{% elif p.is_video %} -
+
{% elif p.is_audio %} -
+
{% elif p.is_youtube %} -
+
{{p.embed_url | safe}}
{% endif %}