{% extends "base.html" %}

{% block extrahead %}
    <script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script>
{% endblock %}

{% load filters %}
{% block bodycontent %}
    {% if nodes %}
        <table id="nodes" class="table">
            <thead>
                <tr>
                    <th class="node_name">Name</th>
                    <th class="node_ip">IP Address</th>
                    <th class="node_env">Environment</th>
                    <th class="node_role">Role</th>
                </tr>
            </thead>
            {% for node in nodes %}
                <tr>
                    <td class="node_name">
                        {{ node.name }}
                    </td>
                    <td class="node_ip">
                        {{ node.ipaddress }}
                    </td>
                    <td class="node_env">
                        {{ node.chef_environment }}
                    </td>
                    <td class="node_role">
                        {% for entry in node.role %}{% if not entry|is_environment_role %}{{ entry }}{% if not forloop.last %}, {% endif %}{% endif %}{% endfor %}
                    </td>
                </tr>
            {% endfor %}
        </table>
    {% endif %}
{% endblock %}

{% block bodytail %}
<script type="text/javascript">
    $(document).ready(function() {
        setupClickHandlers();
    });
    $('#nodes').dataTable({
        "bPaginate": false
    });
    $('#nodes_filter input:text').focus();
</script>
{% endblock %}

{% extends "base.html" %}

{% block extrahead %}
    <script type="text/javascript" src="/static/js/jquery.dataTables.min.js"></script>
{% endblock %}

{% load filters %}
{% block bodycontent %}
    {% if nodes %}
        <table id="nodes" class="table">
            <thead>
                <tr>
                    <th class="node_name">Name</th>
                    <th class="node_ip">IP Address</th>
                    <th class="node_env">Environment</th>
                    <th class="node_role">Role</th>
                </tr>
            </thead>
            {% for node in nodes %}
                <tr>
                    <td class="node_name">
                        {{ node.name }}
                    </td>
                    <td class="node_ip">
                        {{ node.ipaddress }}
                    </td>
                    <td class="node_env">
                        {{ node.chef_environment }}
                    </td>
                    <td class="node_role">
                        {% for entry in node.role %}{% if not entry|is_environment_role %}{{ entry }}{% if not forloop.last %}, {% endif %}{% endif %}{% endfor %}
                    </td>
                </tr>
            {% endfor %}
        </table>
    {% endif %}
{% endblock %}

{% block bodytail %}
<script type="text/javascript">
    $(document).ready(function() {
        setupClickHandlers();
        $('#nodes').dataTable({
            "bPaginate": false
        });
        $('#nodes_filter input:text').focus();
    });
</script>
{% endblock %}

Initialize datatable on document load
Initialize datatable on document load
