This commit is contained in:
Cayo Puigdefabregas 2022-04-26 11:52:51 +02:00
parent f34fedfb74
commit 9dbebed9d5
3 changed files with 5 additions and 9 deletions

View file

@ -1,6 +1,6 @@
from flask import g
from flask_wtf import FlaskForm
from wtforms import HiddenField, IntegerField, StringField, validators
from wtforms import IntegerField, StringField, validators
from ereuse_devicehub.db import db
from ereuse_devicehub.resources.device.models import Device
@ -48,7 +48,7 @@ class TagUnnamedForm(FlaskForm):
class PrintLabelsForm(FlaskForm):
devices = HiddenField(render_kw={'class': "devicesList"})
devices = StringField(render_kw={'class': "devicesList d-none"})
def validate(self, extra_validators=None):
is_valid = super().validate(extra_validators)

View file

@ -1,5 +1,4 @@
$(document).ready(function() {
$(".deviceSelect").on("change", deviceSelect);
var show_allocate_form = $("#allocateModal").data('show-action-form');
var show_datawipe_form = $("#datawipeModal").data('show-action-form');
var show_trade_form = $("#tradeLotModal").data('show-action-form');
@ -12,6 +11,8 @@ $(document).ready(function() {
} else if (show_trade_form != "None") {
$("#tradeLotModal .btn-primary").show();
newTrade(show_trade_form);
} else {
$(".deviceSelect").on("change", deviceSelect);
}
// $('#selectLot').selectpicker();
})
@ -180,11 +181,6 @@ function export_file(type_file) {
}
}
function print_labels() {
deviceSelect();
$('#print_labels').submit();
}
/**
* Reactive lots button

View file

@ -237,7 +237,7 @@
{% for f in form_print_labels %}
{{ f }}
{% endfor %}
<a href="javascript:print_labels()" class="dropdown-item">
<a href="javascript:$('#print_labels').submit()" class="dropdown-item">
<i class="bi bi-printer"></i>
Print labels
</a>