From 2258b1856661f3421f4f0b4a6c8ff262352963fe Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Sun, 11 Dec 2022 21:32:30 +0200 Subject: [PATCH] show the votes button to logged-out niggas --- files/helpers/const.py | 1 - files/routes/votes.py | 2 +- files/templates/comments.html | 8 ++++++-- files/templates/post_actions.html | 4 +++- files/templates/post_actions_mobile.html | 2 +- 5 files changed, 11 insertions(+), 6 deletions(-) diff --git a/files/helpers/const.py b/files/helpers/const.py index 1d2c2630c..b27dab056 100644 --- a/files/helpers/const.py +++ b/files/helpers/const.py @@ -225,7 +225,6 @@ PERMS = { # Minimum admin_level to perform action. 'HOLE_CREATE': 0, 'EDIT_RULES': 3, 'FLAGS_REMOVE': 2, - 'VOTES_VISIBLE': 0, 'USER_BLOCKS_VISIBLE': 0, 'USER_FOLLOWS_VISIBLE': 0, 'USER_VOTERS_VISIBLE': 0, diff --git a/files/routes/votes.py b/files/routes/votes.py index a6cdebe78..ee2e0955a 100644 --- a/files/routes/votes.py +++ b/files/routes/votes.py @@ -6,7 +6,7 @@ from files.__main__ import app, limiter @app.get("/votes/") -@admin_level_required(PERMS['VOTES_VISIBLE']) +@auth_required def vote_info_get(v, link): try: if "p_" in link: thing = get_post(int(link.split("p_")[1]), v=v) diff --git a/files/templates/comments.html b/files/templates/comments.html index 77179039b..50a87e323 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -397,7 +397,9 @@ {% endif %} - {% if v and ((not c.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}Votes{% endif %} + {% if not c.ghost or (v and v.id == AEVANN_ID) %} + Votes + {% endif %} Context @@ -581,7 +583,9 @@