- Add Pessoa/Vinculo.atualizado_manualmente flag, set automatically on web CRUD save; all Gennera/txt import paths now skip records flagged this way instead of overwriting them - Vinculo import: finalize step corrects leftover "situacao nao informada" vinculos to "Desvinculado", pulling carga horaria from censup_carga_horaria - Generic CRUD list view: click a column header to sort (asc/desc), persists through pagination; FK columns sort by their related display field - Rename GENNERA_API_BASE_URL setting to GENNERA_LOCAL_BASE_URL Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
131 lines
4.9 KiB
HTML
131 lines
4.9 KiB
HTML
{% extends "base.html" %}
|
|
|
|
{% block title %}{{ config.title }} | Autocensup{% endblock %}
|
|
{% block page_pretitle %}Cadastros{% endblock %}
|
|
{% block page_title %}{{ config.title }}{% endblock %}
|
|
|
|
{% block page_actions %}
|
|
<a href="{% url 'crud_create' config.slug %}" class="btn btn-primary">
|
|
<i class="ti ti-plus me-2"></i>
|
|
Novo
|
|
</a>
|
|
{% endblock %}
|
|
|
|
{% block content %}
|
|
<div class="row row-cards">
|
|
<div class="col-12">
|
|
<form method="get" class="card">
|
|
<div class="card-body">
|
|
<div class="input-icon">
|
|
<span class="input-icon-addon">
|
|
<i class="ti ti-search"></i>
|
|
</span>
|
|
<input
|
|
type="search"
|
|
name="q"
|
|
value="{{ query }}"
|
|
class="form-control"
|
|
placeholder="Pesquisar"
|
|
>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
<div class="col-12">
|
|
<div class="card">
|
|
<div class="table-responsive">
|
|
<table class="table table-vcenter card-table table-hover">
|
|
<thead>
|
|
<tr>
|
|
{% for field in config.list_fields %}
|
|
<th>
|
|
<a
|
|
href="?q={{ query|urlencode }}&sort={{ field }}&dir={% if sort == field and dir == 'asc' %}desc{% else %}asc{% endif %}"
|
|
class="text-reset text-decoration-none d-inline-flex align-items-center gap-1"
|
|
>
|
|
{{ field }}
|
|
{% if sort == field %}
|
|
<i class="ti ti-chevron-{% if dir == 'asc' %}up{% else %}down{% endif %}"></i>
|
|
{% endif %}
|
|
</a>
|
|
</th>
|
|
{% endfor %}
|
|
<th class="w-1"></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
{% for row in rows %}
|
|
<tr>
|
|
{% for item in row.values %}
|
|
<td>
|
|
{% if item.is_boolean %}
|
|
{% if item.raw %}
|
|
<span class="text-green" title="Sim">
|
|
<i class="ti ti-check"></i>
|
|
</span>
|
|
{% else %}
|
|
<span class="text-secondary" title="Nao">-</span>
|
|
{% endif %}
|
|
{% elif item.is_status %}
|
|
{% if item.value %}
|
|
<span class="badge {{ item.status_class }}">{{ item.value }}</span>
|
|
{% else %}
|
|
-
|
|
{% endif %}
|
|
{% else %}
|
|
{{ item.value|default:"-" }}
|
|
{% endif %}
|
|
</td>
|
|
{% endfor %}
|
|
<td>
|
|
<div class="btn-list flex-nowrap">
|
|
<a href="{% url 'crud_detail' config.slug row.object.pk %}" class="btn btn-icon" aria-label="Ver">
|
|
<i class="ti ti-eye"></i>
|
|
</a>
|
|
<a href="{% url 'crud_update' config.slug row.object.pk %}" class="btn btn-icon" aria-label="Editar">
|
|
<i class="ti ti-pencil"></i>
|
|
</a>
|
|
<a href="{% url 'crud_delete' config.slug row.object.pk %}" class="btn btn-icon text-danger" aria-label="Excluir">
|
|
<i class="ti ti-trash"></i>
|
|
</a>
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
{% empty %}
|
|
<tr>
|
|
<td colspan="{{ config.list_fields|length|add:1 }}" class="text-center text-secondary">
|
|
Nenhum registro encontrado.
|
|
</td>
|
|
</tr>
|
|
{% endfor %}
|
|
</tbody>
|
|
</table>
|
|
</div>
|
|
{% if page_obj.paginator.num_pages > 1 %}
|
|
<div class="card-footer d-flex align-items-center">
|
|
<p class="m-0 text-secondary">
|
|
Pagina {{ page_obj.number }} de {{ page_obj.paginator.num_pages }}
|
|
</p>
|
|
<ul class="pagination m-0 ms-auto">
|
|
{% if page_obj.has_previous %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?q={{ query|urlencode }}&sort={{ sort }}&dir={{ dir }}&page={{ page_obj.previous_page_number }}">
|
|
<i class="ti ti-chevron-left"></i>
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
{% if page_obj.has_next %}
|
|
<li class="page-item">
|
|
<a class="page-link" href="?q={{ query|urlencode }}&sort={{ sort }}&dir={{ dir }}&page={{ page_obj.next_page_number }}">
|
|
<i class="ti ti-chevron-right"></i>
|
|
</a>
|
|
</li>
|
|
{% endif %}
|
|
</ul>
|
|
</div>
|
|
{% endif %}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
{% endblock %}
|