{% extends "base.html" %} {% from 'components/permission_wrapper.html' import permission_button, permission_table, permission_data_section %} {% block title %}Militantes{% endblock %} {% block content %}

Militantes

{{ permission_button('create_cell_member', url_for('militante.novo'), 'Novo Militante', 'fas fa-plus', 'btn-success') }}
{% if user_can('view_cell_data') %}
{% endif %} {% call permission_data_section('view_cell_data', militantes, '', 'Nenhum militante encontrado') %}
{% if user_can('manage_cell_members') %} {% endif %} {% for militante in militantes %} {% if user_can('manage_cell_members') %} {% endif %} {% endfor %}
Nome Email Telefone Célula Estado Responsabilidades Ações
{{ militante.nome[0].upper() }}
{{ militante.nome }}
{% if militante.cpf %} CPF: {{ militante.cpf }} {% endif %}
{% if militante.emails %} {{ militante.emails[0].endereco_email }} {% else %} - {% endif %} {% if militante.telefone1 %} {{ militante.telefone1 }} {% else %} - {% endif %} {% if militante.celula %} {{ militante.celula.nome }} {% else %} - {% endif %} {% if militante.estado %} {% set estado_classes = { 'ATIVO': 'bg-success', 'LICENCIADO': 'bg-warning', 'SUSPENSO': 'bg-danger', 'DESLIGADO': 'bg-secondary' } %} {{ militante.estado.value.title() }} {% else %} Ativo {% endif %}
{% for resp in militante.get_responsabilidades() %} {{ resp }} {% endfor %}
{% if user_can('manage_sector_cells') %} {% endif %}
{% endcall %} {% if user_can('view_cell_reports') %}
Total

{{ militantes|length }}

Ativos

{{ militantes|selectattr('estado.value', 'equalto', 'ATIVO')|list|length }}

Licenciados

{{ militantes|selectattr('estado.value', 'equalto', 'LICENCIADO')|list|length }}

Aspirantes

{{ militantes|selectattr('aspirante', 'equalto', true)|list|length }}

{% endif %}
{% if user_can('manage_cell_members') %} {% include 'modals/militante_editar.html' %} {% include 'modals/militante_excluir.html' %} {% endif %} {% endblock %} {% block extra_js %} {% endblock %}