first step for render actions view

This commit is contained in:
Cayo Puigdefabregas 2022-01-04 12:56:28 +01:00
parent 8333d6804c
commit 18fead559c
4 changed files with 15 additions and 11 deletions

View File

@ -73,3 +73,11 @@ class LotForm(FlaskForm):
return self.instance return self.instance
class NewActionForm(FlaskForm):
name = StringField(u'Name')
date = StringField(u'Date')
severity = StringField(u'Severity')
description = StringField(u'Description')
def save(self):
pass

View File

@ -1,4 +1,4 @@
$(document) .ready(function() { $(document) .ready(function() {
$(".deviceSelect").on("change", deviceSelect); $(".deviceSelect").on("change", deviceSelect);
// $('#selectLot').selectpicker(); // $('#selectLot').selectpicker();
}) })
@ -25,5 +25,5 @@ function deviceSelect() {
} }
function newAction(action) { function newAction(action) {
return action; console.log(action);
} }

View File

@ -1,9 +1,9 @@
<div class="modal fade" id="actionModal" tabindex="-1" style="display: none;" aria-hidden="true"> <div class="modal fade" id="actionModal" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal-dialog"> <div class="modal-dialog modal-fullscreen">
<div class="modal-content"> <div class="modal-content">
<div class="modal-header"> <div class="modal-header">
<h5 class="modal-title">Adding to a lot</h5> <h5 class="modal-title">New Action</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button> <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div> </div>
@ -11,20 +11,15 @@
{{ form_lot_device.csrf_token }} {{ form_lot_device.csrf_token }}
<div class="modal-body"> <div class="modal-body">
Please write a name of a lot Please write a name of a lot
<select class="form-control selectpicker" id="selectLot" name="lot" data-live-search="true">
{% for lot in lots %}
<option value="{{ lot.id }}">{{ lot.name }}</option>
{% endfor %}
</select>
<input class="devicesList" type="hidden" name="devices" /> <input class="devicesList" type="hidden" name="devices" />
<p class="text-danger"> <p class="text-danger">
You need select first some device for adding this in a lot You need select first some device before to do one action
</p> </p>
</div> </div>
<div class="modal-footer"> <div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button> <button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<input type="submit" class="btn btn-primary d-none" value="Save changes" /> <input type="submit" class="btn btn-primary d-none" value="Create" />
</div> </div>
</form> </form>

View File

@ -232,6 +232,7 @@
</section> </section>
{% include "inventory/addinglot.html" %} {% include "inventory/addinglot.html" %}
{% include "inventory/removinglot.html" %} {% include "inventory/removinglot.html" %}
{% include "inventory/actions.html" %}
<!-- CDN --> <!-- CDN -->
<script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest"></script> <script src="https://cdn.jsdelivr.net/npm/simple-datatables@latest"></script>