{# `nvm_url` lets a caller redirect NVM elsewhere (the room gate-view passes #}
{# the table-hex URL so NVM returns to the hex, not out to /gameboard/).     #}
{# Defaults to the gameboard listing — room.html's own gear menu is unchanged.#}
{% if not nvm_url %}{% url 'gameboard' as nvm_url %}{% endif %}
<div id="id_room_menu" style="display:none">
    <a href="{{ nvm_url }}" class="btn btn-cancel">NVM</a>
    {% if request.user == room.owner %}
    <form method="POST" action="{% url 'epic:delete_room' room.id %}">
        {% csrf_token %}
        <button type="submit" class="btn btn-danger" data-confirm="Delete this room?">DEL</button>
    </form>
    {% else %}
    <form method="POST" action="{% url 'epic:abandon_room' room.id %}">
        {% csrf_token %}
        <button type="submit" class="btn btn-abandon" data-confirm="Leave this room?">BYE</button>
    </form>
    {% endif %}
</div>
{% include "apps/applets/_partials/_gear.html" with menu_id="id_room_menu" %}

