{% load i18n guardian_tags %}{% spaceless %}
{% if user.is_authenticated %}
{% get_obj_perms user for page_instance as "page_perms" %}
{% endif %}
<div class="clearfix">
    <ul class="button-group radius right">
        {% if "change_page" in page_perms or 'sveedocuments.change_page' in perms %}
            <li><a class="button tiny secondary" href="{% url 'sveedocuments:page-edit' page_instance.slug %}">{% trans "Edit" %}</a></li>
        {% endif %}
        {% if "delete_page" in page_perms or 'sveedocuments.delete_page' in perms %}
            <li><a class="button tiny secondary" href="{% url 'sveedocuments:page-delete' page_instance.slug %}">{% trans "Delete" %}</a></li>
        {% endif %}
        <li><a class="button tiny secondary" href="{% url 'sveedocuments:page-source' page_instance.slug %}">{% trans "Plain text version" %}</a></li>
        {% if pdf_export_enabled %}
            <li><a class="button tiny secondary" href="{% url 'sveedocuments:page-pdf' page_instance.slug %}">{% trans "PDF version" %}</a></li>
        {% endif %}
        {% if attachments %}
        <li><a class="button tiny secondary" href="#attachments">{% trans "Attachments" %}</a></li>
        {% endif %}
    </ul>
</div>
{% endspaceless %}