{% load pages_tags i18n adminmedia %}

{% if has_permission %}
<tr id="page-row-{{ page.id }}" class="child-of-{{ page.parent.id }}">
<td {% if level %}style="padding-left:{{level}}em"{% endif %}>
    <span id="move-target-{{ page.id }}" class="move-target-container" style="display:none;float:right">
        <a href="#" class="move-target left" title="{% trans "as left sibling"%}"><img alt="" src="{% admin_media_prefix %}img/admin/arrow-up.gif"/></a> |
        <a href="#" class="move-target right" title="{% trans "as right sibling"%}"><img alt="" src="{% admin_media_prefix %}img/admin/arrow-down.gif"/></a></a> |
        <a href="#" class="move-target first-child" title="{% trans "as child"%}">↘</a>
    </span>
    <a href="#" {% ifequal 0 page.children.all.count %}style="display: none"{% endifequal %} id="c{{ page.id }}" class="collapse">
        <span class="collapsed">+</span>
        <span>-</span>
    </a>
    <a href="{{ url }}{{ page.id }}/" class="changelink" style="margin-right:1em;">{% show_content page "slug" %}</a>
</td>
<td>
    <a href="#" class="move" id="move-link-{{ page.id }}">{% trans "move" %}</a> |
    <a href="#" class="addlink" id="add-link-{{ page.id }}">{% trans "add" %}</a> |
    <a href="{{ page.get_absolute_url }}" class="selector-add">{% trans "view" %}</a> |
    <a href="{{ page.id }}/delete/" class="deletelink">{% trans "delete" %}</a>
</td>
<td>
    {% for lang in page.get_languages %} 
        <a href="{{ url }}{{ page.id }}/?language={{ lang }}" class="changelink">{{ lang }}</a>
        <span style="font-weight:normal">{% if not forloop.last %}|{% endif %}</span>
    {% endfor %}
</td>
<td>
{% ifequal page.status page.PUBLISHED %}
    <label>
        <img alt="True" src="{% admin_media_prefix %}img/admin/icon-yes.gif"/>
        <input type="checkbox" class="publish-checkbox" name="status-{{ page.id }}" checked="checked" value="1" />
    </label>
{% else %}
    <label>
        <img alt="False" src="{% admin_media_prefix %}img/admin/icon-no.gif" />
        <input type="checkbox" class="publish-checkbox" name="status-{{ page.id }}" value="0" />
    </label>
{% endifequal %}
</td>
<td>
{{ page.get_template }}
</td>
<td>
{% firstof page.author.get_full_name page.author.first_name page.author.username %}
</td>
</tr>
{% endif %}

{% if children.count %}
{% for child in children %}
    {% pages_admin_menu child url level %}
{% endfor %}
{% endif %}
