{% extends "template.html" %}
{% block content %}
<script type="text/javascript">
var _t=false;

function toggle() {
    $(".sa-app-obj").each(function(){this.checked=_t;});
    _t=!_t;
}
</script>
<style>
.sa-object-list, .sa-object-list LI {
    list-style: none;
    display: inline;
}

.sa-object-list LI {
    float: left;
    width: 200px;
}
</style>
<h1>Run command snippet {{snippet.name}}</h1>
<form method="POST" id="form">
    <div>
        {% if form %}{% include "includes/noc_fieldset.html" %}{% endif %}
        <input type="submit" value="run"/>
    </div>

    <div class="module">
        <table width="100%">
            <caption>Selected Objects: <input type="checkbox" checked onclick="toggle();" /></caption>
            <tr>
                <td>
                    <ul class="sa-object-list">
                        {% for o in objects %}
                            <li>
                                <input type="checkbox" checked name="OBJ:{{o.id}}" id="OBJ:{{o.id}}" class="sa-app-obj" />
                                <label for="OBJ:{{o.id}}">{{o.name}}</label>
                            </li>
                        {% endfor %}
                    </ul>
                </td>
            </tr>
        </table>
    </div>
</form>
{% endblock %}
