show the votes button to logged-out niggas

pull/64/head
Aevann1 2022-12-11 21:32:30 +02:00
parent 59e0beebb2
commit 2258b18566
5 changed files with 11 additions and 6 deletions

View File

@ -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,

View File

@ -6,7 +6,7 @@ from files.__main__ import app, limiter
@app.get("/votes/<link>")
@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)

View File

@ -397,7 +397,9 @@
{% endif %}
{% if v and ((not c.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a href="/votes/{{c.fullname}}" class="btn caction nobackground px-1 text-muted"><i class="fas fa-arrows-v"></i>Votes</a>{% endif %}
{% if not c.ghost or (v and v.id == AEVANN_ID) %}
<a href="/votes/{{c.fullname}}" class="btn caction nobackground px-1 text-muted"><i class="fas fa-arrows-v"></i>Votes</a>
{% endif %}
<a class="btn caction nobackground px-1 text-muted" href="{{c.permalink}}"><i class="fas fa-book-open"></i>Context</a>
@ -581,7 +583,9 @@
<div class="modal-body">
<ul class="list-group comment-actions">
{% if v and ((not c.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a href="/votes/{{c.fullname}}"><li class="list-group-item"><i class="fas fa-arrows-v mr-2"></i>Votes</li></a>{% endif %}
{% if not c.ghost or (v and v.id == AEVANN_ID) %}
<a href="/votes/{{c.fullname}}"><li class="list-group-item"><i class="fas fa-arrows-v mr-2"></i>Votes</li></a>
{% endif %}
<a class="list-group-item" href="{{c.permalink}}"><i class="fas fa-book-open mr-2"></i>Context</a>

View File

@ -6,7 +6,9 @@
{% endif %}
{% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}<a class="list-inline-item" href="/votes/{{p.fullname}}"><i class="fas fa-arrows-v"></i>Votes</a>{% endif %}
{% if not p.ghost or (v and v.id == AEVANN_ID) %}
<a class="list-inline-item" href="/votes/{{p.fullname}}"><i class="fas fa-arrows-v"></i>Votes</a>
{% endif %}
{% if v and FEATURES['AWARDS'] %}
<button type="button" class="list-inline-item text-muted d-none d-md-inline-block" data-bs-toggle="modal" data-bs-target="#awardModal" data-url='/award/post/{{p.id}}' onclick="document.getElementById('giveaward').dataset.action = this.dataset.url"><i class="fas fa-gift fa-fw"></i>Give Award</button>

View File

@ -6,7 +6,7 @@
{% endif %}
{% if v and ((not p.ghost and v.admin_level >= PERMS['VOTES_VISIBLE']) or v.id == AEVANN_ID) %}
{% if not p.ghost or (v and v.id == AEVANN_ID) %}
<a class="nobackground btn btn-link btn-block btn-lg text-left text-muted" href="/votes/{{p.fullname}}">
<i class="fas fa-arrows-v text-center text-muted mr-2"></i>Votes
</a>