confirmation dialog when deleting a lot

This commit is contained in:
Cayo Puigdefabregas 2022-01-12 20:26:14 +01:00
parent 18fc0e6e5b
commit aba5b9dc3b
4 changed files with 28 additions and 4 deletions

View file

@ -45,11 +45,11 @@
<div class="btn-group dropdown ml-1">
{% if lot and lot.is_temporary and not lot.devices %}
<a href="{{ url_for('inventory.devices.lot_del', id=lot.id)}}" type="button" class="btn btn-primary">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="modal" data-bs-target="#btnRemoveLots">
<i class="bi bi-trash"></i>
Remove Lot
<span class="caret"></span>
</a>
</button>
{% else %}
<button id="btnLots" type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false">
<i class="bi bi-folder2"></i>
@ -241,8 +241,9 @@
</div>
</div>
</section>
{% include "inventory/addinglot.html" %}
{% include "inventory/removinglot.html" %}
{% include "inventory/addDeviceslot.html" %}
{% include "inventory/removeDeviceslot.html" %}
{% include "inventory/removelot.html" %}
{% include "inventory/actions.html" %}
<!-- CDN -->

View file

@ -0,0 +1,23 @@
<div class="modal fade" id="btnRemoveLots" tabindex="-1" style="display: none;" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Remove Lot</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
Are you sure that you want to remove lot <strong>{{ lot.name }}</strong>?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
<a href="{{ url_for('inventory.devices.lot_del', id=lot.id)}}" type="button" class="btn btn-primary">
Save changes
</a>
</div>
</div>
</div>
</div>