{% load i18n %}
{% load lfc_tags %}

<ul class="sf-menu">
    {% ifhasperm add %}
        <li>
        {% if display_content_menu %}
            <a>{% trans "Add" %}</a>
            <ul>
            {% for content_type in content_types %}
                <li>
                    <a class="ajax-link"
                       href="{% url 'lfc_add_object' obj.id %}?type={{ content_type.type }}">{% trans content_type.name %}</a>
               </li>
            {% endfor %}
            </ul>
        {% else %}
            {% for content_type in content_types %}
                <a class="ajax-link"
                   href="{% url 'lfc_add_object' obj.id %}?type={{ content_type.type }}">{% trans "Add" %}: {% trans content_type.name %}</a>
            {% endfor %}
        {% endif %}
        </li>
    {% endifhasperm %}
    {% if display_action_menu %}
        <li>
            <a>{% trans "Actions" %}</a>
            <ul>
                {% ifhasperm add %}
                <li>
                    <a class="ajax-link"
                       href="{% url 'lfc_copy' obj.id %}">{% trans 'Copy' %}</a>
                </li>
                {% endifhasperm %}
                {% ifhasperm delete %}
                    <li>
                        <a class="ajax-link"
                           href="{% url 'lfc_cut' obj.id %}">{% trans 'Cut' %}</a>
                    </li>
                {% endifhasperm %}
                {% if display_paste %}
                    {% ifhasperm add %}
                        <li>
                            <a class="ajax-link"
                               href="{% url 'lfc_paste' obj.id %}">{% trans 'Paste' %}</a>
                        </li>
                    {% endifhasperm %}
                {% endif %}
                {% ifhasperm delete %}
                    <li>
                        <a class="delete-link" href="{% url 'lfc_delete_object' obj.id %}">{% trans 'Delete' %}</a>
                    </li>
                {% endifhasperm %}
            </ul>
        </li>
    {% endif %}
    {% if LFC_MULTILANGUAGE %}
        <li>
            {% if translations %}
                <a>{{ obj.get_language_display }}</a>
                <ul>
                    <li>
                        <a {% ifequal canonical.language obj.language %}class="selected"{% endifequal %}
                           href="{% url 'lfc_manage_object' canonical.id %}">
                            {{ canonical.get_language_display }}
                        </a>
                    </li>
                    {% for translation in translations %}
                        <li>
                            <a {% ifequal translation.language obj.language %}class="selected"{% endifequal %}
                                href="{% url 'lfc_manage_object' translation.id %}">
                                {{ translation.get_language_display }}
                            </a>
                        </li>
                    {% endfor %}
                </ul>
            {% endif %}
        </li>
        {% ifhasperm edit %}
            <li>
                {% if obj.is_canonical %}
                    <a>{% trans 'Translate to' %}</a>
                    <ul>
                        {% for language in languages %}
                            <li>
                                <a href="{% url 'lfc_translate_object' obj.id language.code %}">{{ language.name }}</a>
                            </li>
                        {% endfor %}
                    </ul>
                {% else %}
                    {% if obj.canonical %}
                        <a>{% trans 'Translate to' %}</a>
                        <ul>
                            {% for language in languages %}
                            <li>
                                <a href="{% url 'lfc_translate_object' obj.canonical.id language.code %}">{{ language.name }}</a>
                            </li>
                            {% endfor %}
                        </ul>
                    {% endif %}
                {% endif %}
            </li>
        {% endifhasperm %}
    {% endif %}
    {% if LFC_MANAGE_WORKFLOWS %}

    {% endif %}
    {% if state %}
        <li>
            <a>{% trans state.name %}</a>
            {% if transitions %}
                <ul>
                    {% for transition in transitions %}
                        <li>
                            <a class="ajax-link"
                                href="{% url 'lfc_manage_do_transition' obj.id %}?transition={{ transition.id }}">
                                {% trans transition.name %}
                            </a>
                        </li>
                    {% endfor %}
                </ul>
            {% endif %}
        </li>
    {% endif %}
    <li>
        <div id="object-view-link">
            {% include "lfc/manage/object_view_link.html" %}
        </div>
    </li>
    <li>
        <div id="object-quick-view-link">
            {% include "lfc/manage/object_quick_view_link.html" %}
        </div>
    </li>
    <li>
        <img class="ajax-loading" src="{{ STATIC_URL }}lfc/img/ajax-loader.gif" alt="ajax-loader" />
    </li>
</ul>
