condition checking and renaming
This commit is contained in:
parent
6d909d5883
commit
f9674b4ad8
|
@ -8,22 +8,26 @@
|
||||||
<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>
|
||||||
|
<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>
|
</button>
|
||||||
<ul class="dropdown-menu" aria-labelledby="addStateDropdown">
|
{% endif %}
|
||||||
{% 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>
|
|
||||||
|
|
||||||
</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">
|
||||||
|
@ -334,15 +339,14 @@
|
||||||
<i class="bi bi-arrow-right-circle text-danger me-2"></i>
|
<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-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>
|
||||||
<span class="text-success fw-bold me-2">{% trans "To:" %}</span>
|
<span class="text-success fw-bold me-2">{% trans "To:" %}</span>
|
||||||
<span class="text-success fw-italic">{{ state.state }}</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">
|
<div class="form-check form-switch mt-3 d-flex justify-content-end">
|
||||||
<label class="form-check-label font-monospace" for="addNoteCheckbox{{ state.id }}">
|
<label class="form-check-label font-monospace" for="addNoteCheckbox{{ state.id }}">
|
||||||
|
@ -369,7 +373,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue