{# Gear menu on post.html — mirrors apps/gameboard/_partials/_room_gear.html. #}
{# All Posts get the gear w. NVM (back to my_posts).                          #}
{# User-Posts add DEL (owner) or BYE (invitee).                               #}
{# Admin-Posts (kind=NOTE_UNLOCK) intentionally have NVM only — DEL + BYE     #}
{# don't apply to system-authored threads.                                    #}
{# Anonymous viewers (Percival ch.18 anonymous-post lab) get no gear at all   #}
{# — they can't DEL/BYE and the my_posts NVM target needs request.user.id.   #}
{% if request.user.is_authenticated %}
<div id="id_post_menu" style="display:none">
    <a href="{% url 'billboard:my_posts' user_id=request.user.id %}" class="btn btn-cancel">NVM</a>
    {% if post.kind != 'note_unlock' %}
        {% if viewer_is_owner %}
        <form method="POST" action="{% url 'billboard:delete_post' post.id %}">
            {% csrf_token %}
            <button type="submit" class="btn btn-danger" data-confirm="Delete this post?">DEL</button>
        </form>
        {% else %}
        <form method="POST" action="{% url 'billboard:abandon_post' post.id %}">
            {% csrf_token %}
            <button type="submit" class="btn btn-abandon" data-confirm="Leave this post?">BYE</button>
        </form>
        {% endif %}
    {% endif %}
</div>
{% include "apps/applets/_partials/_gear.html" with menu_id="id_post_menu" %}
{% endif %}
