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>
</tr> <th scope="col" width="7%" class="text-center">#
</thead> </th>
<tbody id="sortable_list"> <th scope="col" class="">{% trans "State" %}
{% for state_definition in state_definitions %} </th>
<tr data-lookup="{{ state_definition.id }}" style="cursor: pointer;"> <th scope="col" width="15%" class="text-center">{% trans "Actions" %}
<td> </th>
<i class="bi bi-grip-vertical text-muted me-3" aria-hidden="true"></i> </tr>
</td> </thead>
<td class="fw-bold"> <tbody id="sortable_list">
{{ state_definition.order }} {% for state_definition in state_definitions %}
</td> <tr
<td>{{ state_definition.state }}</td> data-lookup="{{ state_definition.id }}"
<td class="text-end d-flex"> style="cursor: grab;"
<button type="button" class="btn btn-primary btn-sm me-1" data-bs-toggle="modal" data-bs-target="#editStateModal{{ state_definition.id }}"> class="align-items-center">
<i class="bi bi-pencil"></i>
</button> <td class="text-center">
<button type="button" id="delete-btn" class="btn btn-danger btn-sm" data-bs-toggle="modal" data-bs-target="#deleteStateModal{{ state_definition.id }}"> <i class="bi bi-grip-vertical text-muted" aria-hidden="true">
<i class="bi bi-trash"></i> </i>
</button> </td>
</td> <td class="fw-bold text-center">
</tr> {{ state_definition.order }}
{% endfor %} </td>
</tbody> <td>
</table> {{ state_definition.state }}
</td>
<!-- 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
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>
</div>
</td>
</tr>
{% endfor %}
</tbody>
</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 %}