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,10 +8,10 @@
<h3>{{ object.shortid }}</h3> <h3>{{ object.shortid }}</h3>
</div> </div>
<div class="col text-end"> <div class="col text-end">
{% if state_definitions %}
<div class="dropdown"> <div class="dropdown">
<button class="btn btn-green-admin dropdown-toggle" type="button" id="addStateDropdown" data-bs-toggle="dropdown" aria-expanded="false"> <button class="btn btn-green-admin dropdown-toggle" type="button" id="addStateDropdown" data-bs-toggle="dropdown" aria-expanded="false">
{% trans "Change state to" %} {% trans "Action" %}
</button> </button>
<ul class="dropdown-menu" aria-labelledby="addStateDropdown"> <ul class="dropdown-menu" aria-labelledby="addStateDropdown">
{% for state in state_definitions %} {% for state in state_definitions %}
@ -23,7 +23,11 @@
{% endfor %} {% endfor %}
</ul> </ul>
</div> </div>
{% else %}
<button class="btn btn-green-admin" type="button" disabled>
{% trans "Action" %}
</button>
{% endif %}
</div> </div>
</div> </div>
@ -314,12 +318,13 @@
</div> </div>
</div> </div>
<!-- add state to device popup modal--> <!-- add state to device - popup modal-->
{% if state_definitions %}
{% for state in 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 fade" id="addStateModal{{ state.id }}" tabindex="-1" aria-labelledby="addStateModalLabel{{ state.id }}" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog">
<form method="post" action=""> <form method="post" action="{% url 'action:new_action'%}">
{% csrf_token %} {% csrf_token %}
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
@ -335,7 +340,6 @@
<span class="text-danger fw-bold me-2">{% trans "From:" %}</span> <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>
<div class="d-flex align-items-center mt-2"> <div class="d-flex align-items-center mt-2">
<i class="bi bi-arrow-right-circle text-success me-2"></i> <i class="bi bi-arrow-right-circle text-success me-2"></i>
@ -369,7 +373,7 @@
</div> </div>
</div> </div>
{% endfor %} {% endfor %}
{% endif %}
{% endblock %} {% endblock %}