add count to allocate action

This commit is contained in:
Cayo Puigdefabregas 2022-02-03 14:05:15 +01:00
parent 7f9a6784e9
commit c10a5f24b4
3 changed files with 12 additions and 6 deletions

View File

@ -61,7 +61,7 @@ function removeTag() {
function newAction(action) { function newAction(action) {
$("#actionModal #type").val(action); $("#actionModal #type").val(action);
$("#actionModal #title-action").html(action); $("#actionModal #title-action").html(action);
devices_count = $(".deviceSelect").filter(':checked').length; var devices_count = $(".deviceSelect").filter(':checked').length;
$("#actionModal .devices-count").html(devices_count); $("#actionModal .devices-count").html(devices_count);
$("#activeActionModal").click(); $("#activeActionModal").click();
} }
@ -69,7 +69,7 @@ function newAction(action) {
function newAllocate(action) { function newAllocate(action) {
$("#allocateModal #type").val(action); $("#allocateModal #type").val(action);
$("#allocateModal #title-action").html(action); $("#allocateModal #title-action").html(action);
devices_count = $(".deviceSelect").filter(':checked').length; var devices_count = $(".deviceSelect").filter(':checked').length;
$("#actionModal .devices-count").html(devices_count); $("#allocateModal .devices-count").html(devices_count);
$("#activeAllocateModal").click(); $("#activeAllocateModal").click();
} }

View File

@ -15,13 +15,12 @@
{% if field == form_new_action.devices %} {% if field == form_new_action.devices %}
<div class="col-12"> <div class="col-12">
{{ field.label(class_="form-label") }}: <span class="devices-count"></span> {{ field.label(class_="form-label") }}: <span class="devices-count"></span>
{{ field(class_="form-control") }} {{ field(class_="devicesList") }}
<p class="text-danger"> <p class="text-danger">
You need select first some device before to do one action You need select first some device before to do one action
</p> </p>
<p class="enumeration-devices"></p> <p class="enumeration-devices"></p>
</div> </div>
{{ field(class_="devicesList") }}
{% elif field == form_new_action.type %} {% elif field == form_new_action.type %}
{{ field(class_="form-control") }} {{ field(class_="form-control") }}
{% else %} {% else %}

View File

@ -22,7 +22,14 @@
{% for field in form_new_allocate %} {% for field in form_new_allocate %}
{% if field != form_new_allocate.csrf_token %} {% if field != form_new_allocate.csrf_token %}
{% if field == form_new_allocate.devices %} {% if field == form_new_allocate.devices %}
{{ field(class_="devicesList") }} <div class="col-12">
{{ field.label(class_="form-label") }}: <span class="devices-count"></span>
{{ field(class_="devicesList") }}
<p class="text-danger">
You need select first some device before to do one action
</p>
<p class="enumeration-devices"></p>
</div>
{% elif field == form_new_allocate.type %} {% elif field == form_new_allocate.type %}
{{ field(class_="form-control") }} {{ field(class_="form-control") }}
{% else %} {% else %}