autocensup/templates/core/crud/detail.html

87 lines
2.8 KiB
HTML

{% extends "base.html" %}
{% block title %}{{ object }} | Autocensup{% endblock %}
{% block page_pretitle %}{{ config.title }}{% endblock %}
{% block page_title %}{{ object }}{% endblock %}
{% block page_actions %}
<div class="btn-list">
<a href="{% url 'crud_list' config.slug %}" class="btn">
<i class="ti ti-arrow-left me-2"></i>
Voltar
</a>
<a href="{% url 'crud_update' config.slug object.pk %}" class="btn btn-primary">
<i class="ti ti-pencil me-2"></i>
Editar
</a>
{% if vinculo_navigation.previous %}
<a href="{% url 'crud_detail' config.slug vinculo_navigation.previous.pk %}" class="btn">
<i class="ti ti-chevron-left me-2"></i>
Vínculo anterior
</a>
{% endif %}
{% if vinculo_navigation.next %}
<a href="{% url 'crud_detail' config.slug vinculo_navigation.next.pk %}" class="btn">
Próximo vínculo
<i class="ti ti-chevron-right ms-2"></i>
</a>
{% endif %}
</div>
{% endblock %}
{% block content %}
<div class="card mb-3">
<div class="table-responsive">
<table class="table table-vcenter card-table">
<tbody>
{% for label, value in fields %}
<tr>
<th class="w-25">{{ label }}</th>
<td>{{ value|default:"-" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% if vinculo_navigation %}
<div class="card">
<div class="card-header">
<h2 class="card-title">Vínculos de {{ vinculo_navigation.pessoa }}</h2>
</div>
<div class="table-responsive">
<table class="table table-vcenter card-table">
<thead>
<tr>
<th>Ano</th>
<th>Curso</th>
<th>Situação</th>
<th class="text-end">Ações</th>
</tr>
</thead>
<tbody>
{% for pessoa_vinculo in vinculo_navigation.vinculos %}
<tr {% if pessoa_vinculo.pk == object.pk %}class="table-active"{% endif %}>
<td>{{ pessoa_vinculo.ano_censo }}</td>
<td>{{ pessoa_vinculo.curso }}</td>
<td>{{ pessoa_vinculo.get_situacao_display }}</td>
<td class="text-end">
{% if pessoa_vinculo.pk == object.pk %}
<span class="badge bg-primary-lt">Atual</span>
{% else %}
<a href="{% url 'crud_detail' config.slug pessoa_vinculo.pk %}" class="btn btn-sm">
<i class="ti ti-arrow-right me-2"></i>
Ver vínculo
</a>
{% endif %}
</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
{% endif %}
{% endblock %}