diff --git a/files/assets/css/main.css b/files/assets/css/main.css index 9441c05af..f588eb706 100644 --- a/files/assets/css/main.css +++ b/files/assets/css/main.css @@ -3959,7 +3959,8 @@ th { height: 28px; } -.profile-pic-20 { +.profile-pic-20, .pp20 { + margin-right: 0.25rem !important; width: 20px; height: 20px; border-radius: 50%; diff --git a/files/helpers/markdown.py b/files/helpers/markdown.py index 6e6b15f5d..d909ff73a 100644 --- a/files/helpers/markdown.py +++ b/files/helpers/markdown.py @@ -77,12 +77,11 @@ class CustomRenderer(HTMLRenderer): try: if g.v.admin_level == 0 and g.v.any_block_exists(user): return f"{space}@{target}" - except BaseException: - pass + except BaseException: pass if not user: return f"{space}@{target}" - return f'{space}@{user.username}' + return f'{space}@{user.username}' def render_sub_mention(self, token): space = token.target[0] @@ -123,7 +122,7 @@ class Renderer(HTMLRenderer): if not user: return f"{space}@{target}" - return f'{space}@{user.username}' + return f'{space}@{user.username}' def render_sub_mention(self, token): space = token.target[0] diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index b613c92fd..3bf3e03e2 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -115,7 +115,7 @@ def sanitize(sanitized, noimages=False): for tag in soup.find_all("img"): - if tag.get("src") and "profile-pic-20" not in tag.get("class", ""): + if tag.get("src") and "pp20" not in tag.get("class", ""): tag["rel"] = "nofollow noopener noreferrer" tag["class"] = "in-comment-image" @@ -136,7 +136,7 @@ def sanitize(sanitized, noimages=False): for tag in soup.find_all("a"): if tag.get("href"): tag["target"] = "_blank" - if site not in tag["href"]: tag["rel"] = "nofollow noopener noreferrer" + if site not in tag["href"] and not tag["href"].startswith('/'): tag["rel"] = "nofollow noopener noreferrer" if re.match("https?://\S+", str(tag.string)): try: tag.string = tag["href"] diff --git a/files/routes/users.py b/files/routes/users.py index e11ad7116..caa61d408 100644 --- a/files/routes/users.py +++ b/files/routes/users.py @@ -684,6 +684,7 @@ def remove_follow(username, v): return {"message": "Follower removed!"} +@app.get("/uid//pic") @app.get("/uid//pic/profile") @limiter.exempt def user_profile_uid(id): diff --git a/files/templates/admins.html b/files/templates/admins.html index 586086e6e..15bff4d3f 100644 --- a/files/templates/admins.html +++ b/files/templates/admins.html @@ -15,7 +15,7 @@ {% for user in admins %} - {{user.username}} + {{user.username}} {{user.coins}} {% endfor %} diff --git a/files/templates/authforms.html b/files/templates/authforms.html index 98a0181b9..441ae6cb5 100644 --- a/files/templates/authforms.html +++ b/files/templates/authforms.html @@ -15,11 +15,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} diff --git a/files/templates/banned.html b/files/templates/banned.html index c7f3657a6..5fb884ca7 100644 --- a/files/templates/banned.html +++ b/files/templates/banned.html @@ -13,9 +13,9 @@ {% for user in users %} {{users.index(user)+1}} - {{user.username}} + {{user.username}} {% if user.ban_reason %}{{user.ban_reason}}{% endif %} - {{user.banned_by.username}} + {{user.banned_by.username}} {% endfor %} diff --git a/files/templates/default.html b/files/templates/default.html index 514034aed..0eb003bd3 100644 --- a/files/templates/default.html +++ b/files/templates/default.html @@ -254,12 +254,12 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/followers.html b/files/templates/followers.html index f914b20b0..8baea4d80 100644 --- a/files/templates/followers.html +++ b/files/templates/followers.html @@ -27,7 +27,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {{user.username}} {% if v.id == u.id %}
Remove follow
{% endif %} diff --git a/files/templates/following.html b/files/templates/following.html index 0b1aa6499..ac9b9e3dc 100644 --- a/files/templates/following.html +++ b/files/templates/following.html @@ -27,7 +27,7 @@ {% for user in users %} {{loop.index}} - {{user.username}} + {{user.username}} {% if v.id == u.id %}
Unfollow
{% endif %} diff --git a/files/templates/formatting.html b/files/templates/formatting.html index a6af7ae53..2aaa02cd6 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -145,7 +145,7 @@ We also have some custom hooks for mentioning users and subreddits. Note that th Username Mention @QuadNarca - @QuadNarca + @QuadNarca Subreddit Mention diff --git a/files/templates/leaderboard.html b/files/templates/leaderboard.html index 64eb4a48f..2ea449660 100644 --- a/files/templates/leaderboard.html +++ b/files/templates/leaderboard.html @@ -17,7 +17,7 @@ {% for user in users1 %} {{users1.index(user)+1}} - {{user.username}} + {{user.username}} {{user.coins}} {% endfor %} @@ -42,7 +42,7 @@ {% for user in users2 %} {{users2.index(user)+1}} - {{user.username}} + {{user.username}} {{user.stored_subscriber_count}} {% endfor %} @@ -67,7 +67,7 @@ {% for user in users3 %} {{users3.index(user)+1}} - {{user.username}} + {{user.username}} {{user.post_count}} {% endfor %} @@ -92,7 +92,7 @@ {% for user in users4 %} {{users4.index(user)+1}} - {{user.username}} + {{user.username}} {{user.comment_count}} {% endfor %} @@ -119,7 +119,7 @@ {% for user in users5 %} {{users5.index(user)+1}} - {{user.username}} + {{user.username}} {{user.received_award_count}} {% endfor %} @@ -146,7 +146,7 @@ {% for user in users7 %} {{users7.index(user)+1}} - {{user.username}} + {{user.username}} {{user.coins_spent}} {% endfor %} @@ -173,7 +173,7 @@ {% for user in users6 %} {{users6.index(user)+1}} - {{user.username}} + {{user.username}} {{user.basedcount}} {% endfor %} diff --git a/files/templates/log.html b/files/templates/log.html index ab6c3c27f..21ec0c15d 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -17,11 +17,11 @@ {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %}
diff --git a/files/templates/login_2fa.html b/files/templates/login_2fa.html index c2dc9b2d8..cd92c187a 100644 --- a/files/templates/login_2fa.html +++ b/files/templates/login_2fa.html @@ -12,7 +12,7 @@ 2-Step Login - {{'SITE_NAME' | app_config}} - + diff --git a/files/templates/patrons.html b/files/templates/patrons.html index de73730d3..837c9d0f8 100644 --- a/files/templates/patrons.html +++ b/files/templates/patrons.html @@ -13,7 +13,7 @@ {% for uid,row in result.items() %} {{loop.index}} - {{row['username']}} + {{row['username']}} diff --git a/files/templates/rentoids.html b/files/templates/rentoids.html index a4f7621c5..038ed2298 100644 --- a/files/templates/rentoids.html +++ b/files/templates/rentoids.html @@ -13,7 +13,7 @@ {% for user in users %} {{users.index(user)+1}} - {{user.username}} + {{user.username}} {% endfor %} diff --git a/files/templates/settings.html b/files/templates/settings.html index aa783f1f7..93df2112e 100644 --- a/files/templates/settings.html +++ b/files/templates/settings.html @@ -55,7 +55,7 @@ - + {% if v.agendaposter %}{% elif v.css %}{% endif %} diff --git a/files/templates/settings2.html b/files/templates/settings2.html index ed5545bae..cde119310 100644 --- a/files/templates/settings2.html +++ b/files/templates/settings2.html @@ -40,10 +40,10 @@ {% if v %} - + {% else %} - + {% endif %} diff --git a/files/templates/settings_blocks.html b/files/templates/settings_blocks.html index bad13f330..bfac54bca 100644 --- a/files/templates/settings_blocks.html +++ b/files/templates/settings_blocks.html @@ -94,7 +94,7 @@ - @{{block.target.username}} + @{{block.target.username}} {{block.created_date}} diff --git a/files/templates/sign_up.html b/files/templates/sign_up.html index 59ccbf6be..70852b68e 100644 --- a/files/templates/sign_up.html +++ b/files/templates/sign_up.html @@ -36,7 +36,7 @@ - + diff --git a/files/templates/sign_up_failed_ref.html b/files/templates/sign_up_failed_ref.html index 853bd451e..c610b8eb6 100644 --- a/files/templates/sign_up_failed_ref.html +++ b/files/templates/sign_up_failed_ref.html @@ -31,7 +31,7 @@ - + diff --git a/files/templates/submit.html b/files/templates/submit.html index e564bfc21..1eef257ac 100644 --- a/files/templates/submit.html +++ b/files/templates/submit.html @@ -25,11 +25,11 @@ {% block stylesheets %} {% if v %} - + {% if v.agendaposter %}{% elif v.css %}{% endif %} {% else %} - + {% endif %} {% endblock %} diff --git a/files/templates/thiefs.html b/files/templates/thiefs.html index 3ff335914..a214a38d5 100644 --- a/files/templates/thiefs.html +++ b/files/templates/thiefs.html @@ -13,7 +13,7 @@ {% for user in successful %} {{successful.index(user)+1}} - {{user.username}} + {{user.username}} {% endfor %} @@ -31,7 +31,7 @@ {% for user in failed2 %} {{failed2.index(user)+1}} - {{user.username}} + {{user.username}} {% endfor %} @@ -49,7 +49,7 @@ {% for user in failed %} {{failed.index(user)+1}} - {{user.username}} + {{user.username}} {% endfor %} diff --git a/files/templates/truescore.html b/files/templates/truescore.html index f1a968971..df19f8e1f 100644 --- a/files/templates/truescore.html +++ b/files/templates/truescore.html @@ -17,7 +17,7 @@ {% for user in users %} {{users.index(user)+1}} - {{user.username}} + {{user.username}} {{user.truecoins}} {% endfor %} diff --git a/files/templates/viewers.html b/files/templates/viewers.html index 8712e2ec0..ec0f54d42 100644 --- a/files/templates/viewers.html +++ b/files/templates/viewers.html @@ -12,7 +12,7 @@ {% for view in viewers %} - {{view.viewer.username}} + {{view.viewer.username}} {{view.last_view_string}} {% endfor %} diff --git a/files/templates/votes.html b/files/templates/votes.html index 5dc1b0400..b77f1b62c 100644 --- a/files/templates/votes.html +++ b/files/templates/votes.html @@ -28,7 +28,7 @@ User {% for vote in ups %} - {{vote.user.username}} + {{vote.user.username}} {% endfor %} @@ -37,7 +37,7 @@ User {% for vote in downs %} - {{vote.user.username}} + {{vote.user.username}} {% endfor %}