{% extends "lfc/manage/base.html" %}
{% load i18n %}

{% block left_slot %}
    <div id="navigation">
        {{ navigation }}
    </div>
{% endblock %}

{% block content %}

    <div class="site-actions">
        <ul class="sf-menu">
            <li>
            {% if display_content_menu %}
                <a>{% trans "Add" %}</a>
                <ul>
                {% for content_type in content_types %}
                    <li>
                        <a 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 href="{% url lfc_add_object obj.id %}?type={{ content_type.type }}">{% trans "Add" %}: {% trans content_type.name %}</a>
                {% endfor %}
            {% endif %}
            </li>
            <li>
                <a class="modalInput" href="{% url lfc_delete_object obj.id %}">{% trans 'Delete' %}</a>
            </li>
            {% 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>
            <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>
            {% endif %}
            <li>
                <a accesskey="v"
                   href="{{ obj.get_absolute_url }}">{% trans 'View' %}</a>
            </li>
        </ul>
    </div>

    <div style="clear:both" id="manage-tabs">

        <ul>
            <li class="ui-tabs-nav-item"><a href="#data">{% trans content_type_name %}</a></li>
            <li class="ui-tabs-nav-item"><a href="#meta_data">{% trans 'Metadata' %}</a></li>
            <li class="ui-tabs-nav-item"><a href="#seo">{% trans 'SEO' %}</a></li>
            <li class="ui-tabs-nav-item"><a href="#images">{% trans 'Images' %}</a></li>
            <li class="ui-tabs-nav-item"><a href="#files">{% trans 'Files' %}</a></li>
            <li class="ui-tabs-nav-item"><a href="#portlets">{% trans 'Portlets' %}</a></li>
            <li class="ui-tabs-nav-item"><a href="#comments">{% trans 'Comments' %}</a></li>
        </ul>

        <div id="data">
            {{ core_data|safe }}
        </div>
        <div id="meta_data">
            {{ meta_data|safe }}
        </div>
        <div id="seo">
            {{ seo_data|safe }}
        </div>
        <div id="images">
            {{ images }}
        </div>
        <div id="files">
            {{ files }}
        </div>
        <div id="portlets">
            {{ portlets }}
        </div>
        <div id="comments">
            {{ comments }}
            </div>
        </div>
    </div>

    <script type="text/javascript">
        tinyMCE.execCommand('mceAddControl', true, 'id_text');
        tinyMCE.execCommand('mceAddControl', true, 'id_short_text');
    </script>

{% endblock %}