Commit 9f41ce36 by Damien Moulard Committed by Alexis Aoun

validation modale before deleting supplier

parent de52adb1
...@@ -17,6 +17,7 @@ ...@@ -17,6 +17,7 @@
display: flex; display: flex;
justify-content: center; justify-content: center;
align-items: center; align-items: center;
flex-wrap: wrap;
margin: 20px 0 20px 0; margin: 20px 0 20px 0;
} }
...@@ -30,7 +31,7 @@ ...@@ -30,7 +31,7 @@
justify-content: center; justify-content: center;
align-items: center; align-items: center;
padding: 8px; padding: 8px;
margin-right: 5px; margin-right: 10px;
} }
.remove_supplier_icon { .remove_supplier_icon {
......
...@@ -155,8 +155,18 @@ function display_suppliers() { ...@@ -155,8 +155,18 @@ function display_suppliers() {
$(".remove_supplier_icon").on("click", function(e) { $(".remove_supplier_icon").on("click", function(e) {
const el_id = $(this).attr('id').split('_'); const el_id = $(this).attr('id').split('_');
const supplier_id = el_id[el_id.length-1] const supplier_id = el_id[el_id.length-1];
let modal_remove_supplier = $('#templates #modal_remove_supplier');
modal_remove_supplier.find(".supplier_name").text(supplier.display_name);
openModal(
modal_remove_supplier.html(),
() => {
remove_supplier(supplier_id); remove_supplier(supplier_id);
},
'Valider',
);
}) })
} }
......
...@@ -43,6 +43,18 @@ ...@@ -43,6 +43,18 @@
</div> </div>
</div> </div>
</div> </div>
<div id="modal_remove_supplier">
<h3>Attention !</h3>
<p>
Vous vous apprêtez à supprimer le fournisseur <span class="supplier_name"></span>.<br/>
Les produits associés à ce fournisseur uniquement seront supprimés.<br/>
Les données renseignées dans la colonne de ce fournisseur seront perdues.
</p>
<p>Êtez-vous sûr ?</p>
<ul id="list_unprocessable_porducts"></ul>
<hr/>
</div>
</div> </div>
<script src="{% static "js/all_common.js" %}?v="></script> <script src="{% static "js/all_common.js" %}?v="></script>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment