{% load rapid_list %}<span class="must_reload"></span>
<style scoped>
    table.object_list > thead > tr > td{
        padding-left: 0.5em;
        padding-right: 0.5em;
        padding-top: 0.5em;
        padding-bottom: 0.5em;
        vertical-align: middle;
    }
    table.object_list > tbody > tr > td{
        padding-left: 0.5em;
        padding-right: 0.5em;
        vertical-align: middle;
    }
    td.list-icons > *{
        margin-right: 1em;
    }
    tr.selectable-row > .selectable-check{
        font-family: FontAwesome;
        margin-right: 6pt;
        font-size: 32pt;
    }
    tr.selectable-row:not(.selected) > .selectable-check{
        zoom: 1;
        filter: alpha(opacity=0);
        opacity: 0;
    }
    tr.selectable-row.selected{
        border-radius: 5pt;
        box-shadow: 0pt 0pt 3pt 5pt #00ff00;
    }
</style>
<h2>{{model.model_name_plural.capitalize}}</h2>
<p>{% for a, u in model.actions %}
	{% if a.action.name != 'list' %}
		<a href="{{ u }}" class="better-in-overlay btn btn-default"><span class="fa {{ a.action.icon }}">{{ a.action.verbose_name.capitalize }}</span></a>
	{% endif %}
{% endfor %}</p>
{% load rapid_filters %}
{% model_filters model %}
<table class="object_list rapid-object-selector table table-striped table-condensed">
    <thead><tr class="selectable-head">
        <td class="selectable-check"><!-- Espaço para um check -->&nbsp;</td>
        {% for f in view.fields %}
        {% field_header f %}
        {% endfor %}
    </tr></thead>
    <tbody>
    {% for o in view.values %}
    <tr class="selectable-row" id="{{ o.instance.pk }}">
        <td class="selectable-check"><!-- Espaço para um check -->&#xf00c;
        <input type="hidden" name="{{ o.instance }}" value="{{ o.instance.pk }}" class="rapid-select-id-marker"></inputhidden></td>
        {% for v, iter in o.values %}
        {% if iter %}
            <td>
            {% for val, val_data in v %}
                {{ val }}
                {% if not forloop.last %}<br>{% endif %}
            {% endfor %}
            </td>
        {% else %}
            <td>{{ v.0 }}</td>
        {% endif %}
        {% endfor %}
    </tr>
    </tbody>
    {% endfor %}
</table>
<p><a class="overlay-commit btn btn-default">Adicionar na seleção</a></p>
<p>{% for a, u in model.actions %}
	{% if a.action.name != 'list' %}
		<a href="{{ u }}" class="better-in-overlay btn btn-default"><span class="fa {{ a.action.icon }}">{{ a.action.verbose_name.capitalize }}</span></a>
	{% endif %}
{% endfor %}</p>
{% pagination %}
<script>
     $(document).ready(function(){
        $("tr.selectable-row").click(function(){
            $(this).toggleClass("selected");
            //$(this).filter(".selected").children(".selectable-check").text("\f00c");
            //$(this).not(".selected").children(".selectable-check").text(" ");
        });
     });
 </script>