Origem do Template: parlamentares/parlamentares_list.html

{% extends "crud/list.html" %}
{% load i18n %}
{% load crispy_forms_tags cropping%}
{% block extra_content %}
  <fieldset class="form-group">
    <legend>Selecione o PerĂ­odo</legend>
    <form method="GET">
      <select name="pk" class="form-control" onChange="form.submit();">
        {% for l in legislaturas %}
          <option value="{{l.id}}" {% if l.id == legislatura_id %} selected {% endif %}>
            {{l}}
          </option>
        {% endfor %}
      </select>
    </form>
  </fieldset>
  <br/>
{% endblock %}

{% block container_table_list %}
  {% if not rows %}
    <p>{{ NO_ENTRIES_MSG }}</p>
  {% else %}
    <div class="container-table">
      <div class="result-count">{% blocktrans with verbose_name_plural=view.verbose_name_plural %}Total de {{ verbose_name_plural }}: <strong>{{count}}</strong>{% endblocktrans %}</div>
      <table class="table table-striped table-hover table-link-ordering">
        <thead>
          <tr>
            {% for name in headers %}
              {% if forloop.first %}
                <th colspan=2>
              {% else %}
                <th>
              {% endif %}
                {{ name }}
              </th>
            {% endfor %}
          </tr>
        </thead>
        <tbody>
        {% for value_list in rows %}
        <tr>
          {% for value, href, obj in value_list %}
            {% if forloop.first %}
                <td> 
                  <img class="avatar-parlamentar" src="{% cropped_thumbnail obj "cropping" %}">
                </td>
            {% endif %}
          <td>
            {% if href %}
                <a href="{{ href }}">{{ value|safe|default:"" }}</a>
            {% else %}
                {{ value|safe|default:"" }}
            {% endif %}
          </td>
          {% endfor %}
        </tr>
        {% endfor %}
      </tbody>
      </table>
    </div>
  {% endif %}
{% endblock %}