<div class="line">
{% if obj.type_icon %}<i title="{{ obj.get_type_display }}" class="{{ obj.type_icon }}"></i>{% endif %}
<form method="post" action="{% url 'orgapy:document' obj.nonce %}">
{% csrf_token %}
<input type="hidden" name="etag" value="{{ obj.etag }}">
<input type="hidden" name="next" value="{{ request.get_full_path }}">
<span class="x-hint" style="min-width: 1.6rem">{{ obj.date_modification_display }}</span>
{% if obj.pinned %}<button class="button-inline" type="submit" name="pinned" value="off"><i class="ri-bookmark-fill"></i></button>{% endif %}
{% if obj.public %}<button class="button-inline" type="submit" name="public" value="off"><i class="ri-lock-line"></i></button>{% endif %}
{% if obj.hidden %}<button class="button-inline" type="submit" name="hidden" value="off"><i class="ri-eye-line"></i></button>{% endif %}
</form>
{% if obj.get_ongoing_projects %}<a class="button button-inline" href="{% url 'orgapy:projects' %}?document={{ obj.nonce }}" title="Projects"><i class="ri-briefcase-line"></i></a>{% endif %}
{% if obj.deleted %}<i class="ri-delete-bin-line"></i><span>{{ obj.title }}</span>{% else %}<a class="link-hidden" href="{{ obj.get_absolute_url }}">{% if obj.title %}{{ obj.title }}{% else %}<i>Untitled</i>{% endif %}</a>{% endif %}
{% if obj.tags.all %}{% for tag in obj.tags.all %}<a class="link-tenuous" href="{{ tag.get_absolute_url }}">#{{tag.name}}</a>{% endfor%}{% else %}<a class="link-tenuous" href="{% url 'orgapy:tag' name='uncategorized' %}">uncategorized</a>{% endif %}
<button popovertarget="menu-{{ obj.nonce }}" title="More options"><i class="ri-more-2-fill"></i></button>
<ul id="menu-{{ obj.nonce }}" popover class="menu">
<form method="post" action="{% url 'orgapy:document' obj.nonce %}">
{% csrf_token %}
<input type="hidden" name="etag" value="{{ obj.etag }}">
<input type="hidden" name="next" value="{{ request.get_full_path }}">
{% if obj.deleted %}
<li class="menu-item"><button type="submit" name="deleted" value="off" class="submit-confirm" message="Do you want to restore '{{ obj.title }}'?"><i class="ri-arrow-left-up-box-line"></i> Restore</button></li>
<li class="menu-item"><button type="submit" name="destroy" value="on" class="button-danger submit-confirm" message="Do you want to PERMANENTLY DELETE '{{ obj.title }}'?"><i class="ri-file-shred-line"></i> Destroy</button></li>
{% else %}
<li class="menu-item"><a href="{% url 'orgapy:document' obj.nonce %}?edit=1" title="Edit"><i class="ri-pencil-fill"></i> Edit</a></li>
<li class="menu-item"><a href="{% url 'orgapy:document' obj.nonce %}?raw=1" title="Raw"><i class="ri-download-line"></i> Raw</a></li>
<li class="menu-item"><button type="submit" name="pinned" value="{% if obj.pinned %}off{% else %}on{% endif %}"><i class="ri-bookmark-fill"></i> {% if obj.pinned %}Unpin{% else %}Pin{% endif %}</button></li>
<li class="menu-item"><button type="submit" name="public" value="{% if obj.public %}off{% else %}on{% endif %}">{% if obj.public %}<i class="ri-lock-line"></i> Make private{% else %}<i class="ri-lock-unlock-line"></i> Make public{% endif %}</button></li>
<li class="menu-item"><button type="submit" name="hidden" value="{% if obj.hidden %}off{% else %}on{% endif %}">{% if obj.hidden %}<i class="ri-eye-off-line"></i> Unhide{% else %}<i class="ri-eye-line"></i> Hide{% endif %}</button></li>
<li class="menu-item"><button type="submit" name="deleted" value="on" class="button-danger submit-confirm" message="Do you want to delete '{{ obj.title }}'?"><i class="ri-delete-bin-line"></i> Delete</button></li>
{% endif %}
</form>
</ul>
</div>