{% extends "adagios_standard.html" %}
{% block title %}Bulk copy{% endblock %}
{% block smallheader %}copy{% endblock %}
{% block largeheader %}objects{% endblock %}
{% block nav1 %}Object Browser{% endblock %}
{% block footer %}
    <script>
        $('table#many').dataTable( {
                    "sPaginationType": "bootstrap",
                    "sScrollY": "260px",
                    "bAutoWidth": false,
                    "bScrollCollapse": true,
                    "bPaginate": false,
                    "sDom": 'rtp'
                }
        );
    </script>
{% endblock %}
{%  block content %}
    <p>
    You are about to copy multible objects
    <p>
    Fill in Attribue Name and New Value and they will be changed on
    all selected items. If object does not currently have this value defined it will be added anyway.
    <p>
    <form action="#" method="post" class="form-horizontal">{% csrf_token %}
        <div>
    {% include "bootstrap_fields.html" with fields=form %}
        <table id="many">
            <thead>
            <tr>
                <th></th>
                <th>Object Type</th>
                <th>Description</th>
                <th>Filename</th>
            </tr>
            </thead>
            <tbody>
            {% for obj in objects %}
                <tr>
                    <td>
                        <input type="hidden" name="hidden_{{ obj.id }}" value="{{ obj.id }}" />
                        <input type="checkbox" checked="checked" name="change_{{ obj.id }}" id="id_{{ obj.id }}" />
                    </td>
                    <td>{{ obj.object_type }}</td>
                    <td>{{ obj.description }}</td>
                    <td>{{ obj.filename }}</td>
                </tr>

            {% endfor %}
            </tbody>
        </table>
        <br/>
        </div>
        <div class="form-actions">
            <button class="btn btn-primary" type="submit">Submit</button>
        </div>
    </form>
{%  endblock %}