loko/streetup/controls/templates/controls/controls_index.html
2026-07-22 14:48:40 +02:00

62 lines
No EOL
2.5 KiB
HTML

{% extends "base.html" %}
{% load static %}
{% load tz %}
{% load i18n %}
{% load short_name %}
{% block content %}
<div class="container mt-2 position-relative">
<div class="position-absolute" style="top: 0px; right: 5px;">
{% if is_add_control_allowed == True %}
<a href="{% url 'controls:controls_add' %}" class="btn btn-light">
<i class="bi bi-plus-circle"></i> {% translate "Nouveau contrôle" %}
</a>
{% endif %}
</div>
<ul class="nav nav-tabs" id="tablesTab" role="tablist">
<li class="nav-item" role="presentation">
<button class="nav-link active" id="controls-tab" data-bs-toggle="tab" data-bs-target="#controls-content" type="button" role="tab" aria-controls="controls" aria-selected="true">{% translate "Contrôles" %}</button>
</li>
</ul>
<div class="tab-content my-2" id="tablesTabContent">
<div class="tab-pane fade show active" id="controls-content" role="tabpanel" aria-labelledby="controls-tab">
<div id="controls-container">
<table id="controls-table" class="table"
data-toggle="table"
data-pagination="true"
data-page-size="25"
data-click-to-select="true"
data-search="true">
<thead>
<tr>
<th>{% translate "Code" %}</th>
<th>{% translate "Description" %}</th>
<th>{% translate "Auteur" %}</th>
<th>{% translate "Type" %}</th>
<th>{% translate "Mise à jour" %}</th>
</tr>
</thead>
<tbody>
{% for control in controls %}
<tr>
<td><a href="{% url 'controls:controls_detail' control.id %}">{{ control.control_code }}</a></td>
<td>{{ control.description }}</td>
<td>{{ control.control_author|short_name }}</td>
<td><span class="badge bg-secondary">{{ control.get_control_type_display }}</span></td>
<td>{{ control.updated_at|timezone:"Europe/Paris"|date:"d/m/Y H:i" }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
</div>
</div>
</div>
{% endblock content%}
{% block script %}
{% endblock script %}