cosmetic changes to statesdefinitions list

This commit is contained in:
Thomas Nahuel Rusiecki 2024-12-16 16:20:15 -03:00
parent 92024a96c1
commit 0217ed6d04

View file

@ -14,41 +14,69 @@
</div> </div>
</div> </div>
<div class="row mt-5"> <div class="row mt-4">
<div class="col"> <div class="col">
{% if state_definitions %} {% if state_definitions %}
<table class="table table-hover table-border"> <table class="table table-hover table-bordered align-middle">
<caption>{% trans 'Move and drag state definitions to reorder' %}</caption> <caption class="text-muted small">
<thead class="align-items-start"> {% trans 'Move and drag state definitions to reorder' %}
<tr class="table-active"> </caption>
<th scope="col" width="1%"></th> <thead class="table-light">
<th scope="col" width="7%">#</th> <tr>
<th scope="col" >{% trans "State" %}</th> <th scope="col" width="1%">
<th scope="col" width="10%" ></th> </th>
<th scope="col" width="7%" class="text-center">#
</th>
<th scope="col" class="">{% trans "State" %}
</th>
<th scope="col" width="15%" class="text-center">{% trans "Actions" %}
</th>
</tr> </tr>
</thead> </thead>
<tbody id="sortable_list"> <tbody id="sortable_list">
{% for state_definition in state_definitions %} {% for state_definition in state_definitions %}
<tr data-lookup="{{ state_definition.id }}" style="cursor: pointer;"> <tr
<td> data-lookup="{{ state_definition.id }}"
<i class="bi bi-grip-vertical text-muted me-3" aria-hidden="true"></i> style="cursor: grab;"
class="align-items-center">
<td class="text-center">
<i class="bi bi-grip-vertical text-muted" aria-hidden="true">
</i>
</td> </td>
<td class="fw-bold"> <td class="fw-bold text-center">
{{ state_definition.order }} {{ state_definition.order }}
</td> </td>
<td>{{ state_definition.state }}</td> <td>
<td class="text-end d-flex"> {{ state_definition.state }}
<button type="button" class="btn btn-primary btn-sm me-1" data-bs-toggle="modal" data-bs-target="#editStateModal{{ state_definition.id }}"> </td>
<i class="bi bi-pencil"></i>
<!-- action buttons -->
<td class="text-center">
<div class="d-flex justify-content-center gap-1">
<button
type="button"
class="btn btn-sm btn-info"
data-bs-toggle="modal"
data-bs-target="#editStateModal{{ state_definition.id }}">
<i class="bi bi-pencil">
</i>
</button> </button>
<button type="button" id="delete-btn" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteStateModal{{ state_definition.id }}"> <button
<i class="bi bi-trash"></i> type="button"
id="delete-btn"
class="btn btn-sm btn-danger"
data-bs-toggle="modal"
data-bs-target="#deleteStateModal{{ state_definition.id }}">
<i class="bi bi-trash">
</i>
</button> </button>
</div>
</td> </td>
</tr> </tr>
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
<form id="orderingForm" method="post" action="{% url 'admin:update_state_order' %}"> <form id="orderingForm" method="post" action="{% url 'admin:update_state_order' %}">
{% csrf_token %} {% csrf_token %}