condition checking and renaming

This commit is contained in:
Thomas Nahuel Rusiecki 2024-12-05 21:30:06 -03:00
parent 6d909d5883
commit f9674b4ad8

View file

@ -8,22 +8,26 @@
<h3>{{ object.shortid }}</h3>
</div>
<div class="col text-end">
<div class="dropdown">
<button class="btn btn-green-admin dropdown-toggle" type="button" id="addStateDropdown" data-bs-toggle="dropdown" aria-expanded="false">
{% trans "Change state to" %}
{% if state_definitions %}
<div class="dropdown">
<button class="btn btn-green-admin dropdown-toggle" type="button" id="addStateDropdown" data-bs-toggle="dropdown" aria-expanded="false">
{% trans "Action" %}
</button>
<ul class="dropdown-menu" aria-labelledby="addStateDropdown">
{% for state in state_definitions %}
<li>
<a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#addStateModal{{ state.id }}">
{{ state.state }}
</a>
</li>
{% endfor %}
</ul>
</div>
{% else %}
<button class="btn btn-green-admin" type="button" disabled>
{% trans "Action" %}
</button>
<ul class="dropdown-menu" aria-labelledby="addStateDropdown">
{% for state in state_definitions %}
<li>
<a class="dropdown-item" href="#" data-bs-toggle="modal" data-bs-target="#addStateModal{{ state.id }}">
{{ state.state }}
</a>
</li>
{% endfor %}
</ul>
</div>
{% endif %}
</div>
</div>
@ -314,12 +318,13 @@
</div>
</div>
<!-- add state to device popup modal-->
<!-- add state to device - popup modal-->
{% if state_definitions %}
{% for state in state_definitions %}
<div class="modal fade" id="addStateModal{{ state.id }}" tabindex="-1" aria-labelledby="addStateModalLabel{{ state.id }}" aria-hidden="true">
<div class="modal-dialog">
<form method="post" action="">
<form method="post" action="{% url 'action:new_action'%}">
{% csrf_token %}
<div class="modal-content">
<div class="modal-header">
@ -334,15 +339,14 @@
<i class="bi bi-arrow-right-circle text-danger me-2"></i>
<span class="text-danger fw-bold me-2">{% trans "From:" %}</span>
<span class="text-danger fw-italic">state_placeholder</span>
<span class="text-danger fw-italic">state_placeholder</span>
</div>
<div class="d-flex align-items-center mt-2">
<i class="bi bi-arrow-right-circle text-success me-2"></i>
<span class="text-success fw-bold me-2">{% trans "To:" %}</span>
<span class="text-success fw-italic">{{ state.state }}</span>
</div>
</div>
</div>
</div>
<div class="form-check form-switch mt-3 d-flex justify-content-end">
<label class="form-check-label font-monospace" for="addNoteCheckbox{{ state.id }}">
@ -369,7 +373,7 @@
</div>
</div>
{% endfor %}
{% endif %}
{% endblock %}