{% load i18n %}

<h2 class="heading-middle">
    {% trans 'Children' %}
</h2>

<form action="{% url lfc_update_portal_children %}"
      method="post">

    {% if children %}
        <table class="lfs-manage-table" width="100%">
            <tr>
                <th class="mini">
                    <input type="checkbox"
                           class="select-all-1" />
                </th>
                <th class="mini">
                    {% trans 'Position' %}
                </th>
                <th>
                    {% trans 'Title' %}
                </th>
                <th>
                    <input type="checkbox"
                           class="select-all-2" />
                    {% trans 'Active' %}
                </th>
                <th class="right last small">
                    {% trans 'Manage' %}
                </th>
            </tr>
            {% for child in children %}
                <tr>
                    <td>
                        <input type="hidden"
                               name="obj_id-{{ child.id }}" />
                        <input type="checkbox"
                               class="select-1"
                               name="delete-{{ child.id }}"
                               style="float:left" />
                    </td>
                    <td>
                        <input type="text"
                               class="position"
                               name="position-{{ child.id }}"
                               value="{{ child.position }}" />
                    </td>
                    <td>
                        {{ child.title }}
                    </td>
                    <td>
                        <input type="checkbox"
                               name="is_active-{{ child.id }}"
                               style="float:left"
                               class="select-2"
                               {% if child.active %}checked="checked"{% endif %} />
                    </td>
                    <td class="right last">
                        <a href="{% url lfc_manage_object child.id %}">
                            <img src="{{ MEDIA_URL }}lfc/icons/edit.png"
                                 alt="{% trans 'Edit' %}"
                                 title="{% trans 'Edit object' %}" />
                        </a>
                        <a href="{{ child.get_absolute_url }}">
                            <img src="{{ MEDIA_URL }}lfc/icons/zoom.png"
                                 alt="{% trans 'View' %}"
                                 title="{% trans 'View object' %}" />
                        </a>
                    </td>
                </tr>
            {% endfor %}
        </table>
        <div class="manage-form-buttons">            
            <input class="ajax-save-button"
                   type="submit" name="update" value="{% trans 'Update' %}" />
            <input class="ajax-save-button"
                   type="submit" name="delete" value="{% trans 'Delete' %}" />
            <input class="ajax-save-button"
                   type="submit" name="copy" value="{% trans 'Copy' %}" />
            <input class="ajax-save-button"
                   type="submit" name="cut" value="{% trans 'Cut' %}" />
                   
            {% if display_paste %}
                <input class="ajax-save-button"
                       type="submit" name="paste" value="{% trans 'Paste' %}" />                
            {% endif %}
        </div>

    {% else %}
        <div>{% trans 'There are no children' %}</div>

        {% if display_paste %}
            <div class="manage-form-buttons">
                <input class="ajax-save-button"
                       type="submit" name="paste" value="{% trans 'Paste' %}" />
            </div>
        {% endif %}
    {% endif %}
</form>