Check to see if v exists

This commit is contained in:
justcool393 2023-07-22 09:27:59 -05:00
parent fbb1129354
commit de55efbb1a
4 changed files with 4 additions and 4 deletions

View file

@ -19,7 +19,7 @@
{% endif %}
{% endif %}
{%- if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- set show_approve = c.state_mod != StateMod.VISIBLE or "/reported/" in request.path -%}
{%- set show_remove = c.state_mod != StateMod.REMOVED -%}
<button id="remove-{{c.id}}" class="btn caction py-0 nobackground px-1 text-danger{% if not show_remove %} d-none{% endif %}" role="button" onclick="moderate(false, {{c.id}}, true, 'remove-{{c.id}}', 'remove2-{{c.id}}', 'approve-{{c.id}}', 'approve2-{{c.id}}');"><i class="fas fa-ban"></i>Remove</a>

View file

@ -27,7 +27,7 @@
<a id="unban2-{{c.id}}" class="{% if not c.author.is_banned %}d-none{% endif %} list-group-item text-success" role="button" onclick="post_toast2(this,'/unban_user/{{c.author_id}}','ban2-{{c.id}}','unban2-{{c.id}}')" data-bs-dismiss="modal"><i class="fas fa-user-minus fa-fw text-success mr-2"></i>Unban user</a>
{% endif %}
{%- if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- set show_approve = c.state_mod != StateMod.VISIBLE or "/reported/" in request.path -%}
{%- set show_remove = c.state_mod == StateMod.VISIBLE -%}
<a id="remove2-{{c.id}}" class="dropdown-item list-inline-item text-danger{% if not show_remove %} d-none{% endif %}" role="button" onclick="moderate(false, {{c.id}}, true, 'remove-{{c.id}}', 'remove2-{{c.id}}', 'approve-{{c.id}}', 'approve2-{{c.id}}');"><i class="fas fa-ban"></i>Remove</a>

View file

@ -58,7 +58,7 @@
<a id="unclub-{{p.id}}" class="dropdown-item {% if not p.club %}d-none{% endif %} list-inline-item text-info" role="button" onclick="post_toast2(this,'/toggle_club/{{p.id}}','club-{{p.id}}','unclub-{{p.id}}')"><i class="fas fa-eye"></i>Unmark club</a>
{% endif %} #}
{%- if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- set show_approve = p.state_mod != StateMod.VISIBLE or "/reported/" in request.path -%}
{%- set show_remove = p.state_mod == StateMod.VISIBLE -%}
<a id="remove-{{p.id}}" class="dropdown-item list-inline-item text-danger{% if not show_remove %} d-none{% endif %}" role="button" onclick="moderate(true, {{p.id}}, true, 'remove-{{p.id}}', 'remove2-{{p.id}}', 'approve-{{p.id}}', 'approve2-{{p.id}}');"><i class="fas fa-ban"></i>Remove</a>

View file

@ -22,7 +22,7 @@
<button id="pin2-{{p.id}}" class="{% if p.stickied %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-primary" role="button" onclick="post_toast2(this,'/sticky/{{p.id}}','pin2-{{p.id}}','unpin2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-primary mr-3"></i>Pin</button>
<button id="unpin2-{{p.id}}" class="{% if not p.stickied %}d-none{% endif %} nobackground btn btn-link btn-block btn-lg text-left text-primary" role="button" onclick="post_toast2(this,'/unsticky/{{p.id}}','pin2-{{p.id}}','unpin2-{{p.id}}')" data-bs-dismiss="modal"><i class="fas fa-thumbtack fa-rotate--45 text-center text-primary mr-3"></i>Unpin</button>
{%- if v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- if v and v.admin_level >= PERMS['POST_COMMENT_MODERATION'] -%}
{%- set show_approve = p.state_mod != StateMod.VISIBLE or "/reported/" in request.path -%}
{%- set show_remove = p.state_mod == StateMod.VISIBLE -%}
<a id="remove2-{{p.id}}" class="dropdown-item list-inline-item text-danger{% if not show_remove %} d-none{% endif %}" role="button" onclick="moderate(true, {{p.id}}, true, 'remove-{{p.id}}', 'remove2-{{p.id}}', 'approve-{{p.id}}', 'approve2-{{p.id}}');"><i class="fas fa-ban"></i>Remove</a>