Commit 0e65c502 by Mathieu Poisbeau

#298: add confirmation modal for Comptoir actions

parent 49789599
...@@ -184,4 +184,38 @@ jQuery(document).ready(function() { ...@@ -184,4 +184,38 @@ jQuery(document).ready(function() {
$('#' + form.name + '_moyen')[0].value = 'cb' $('#' + form.name + '_moyen')[0].value = 'cb'
}); });
/**
* Display a confirmation modal for the 5 actions of a Comptoir
*/
$('form[name^=formVente]')
.add('form[name^=formRetrait]')
.add('form[name=formTransfertPrestataireComptoir]')
.submit(function (e) {
// Stop form submition
e.preventDefault();
var form = this;
// Set form moyen
$('#' + form.name + '_moyen').val('mlc')
if (form.checkValidity()) {
var div = form.name === 'formTransfertPrestataireComptoir' ? '.confirmTransfertPrestataireComptoir' :
form.name.includes('Prestataire') ? '.confirmTransactionPrestataire' :
'.confirmTransactionAdherent'
// Get expediteur or destinataire
var select = $('#' + form.name + (form.name === 'formTransfertPrestataireComptoir' ? '_expediteur' : '_destinataire'))[0]
var name = select.options[select.selectedIndex].text
// Get montant
var montant = $('#' + form.name + '_montant').val()
showConfirmTransactionModal(div, form, montant, name)
} else {
// Use symfony validation
form.submit()
}
});
}); });
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -3,16 +3,16 @@ ...@@ -3,16 +3,16 @@
"app": { "app": {
"js": [ "js": [
"/build/runtime.420770e4.js", "/build/runtime.420770e4.js",
"/build/app.a1cf5950.js" "/build/app.50959599.js"
], ],
"css": [ "css": [
"/build/app.0ecb0d81.css" "/build/app.4ada5381.css"
] ]
}, },
"admin": { "admin": {
"js": [ "js": [
"/build/runtime.420770e4.js", "/build/runtime.420770e4.js",
"/build/admin.3024c297.js" "/build/admin.f9a92453.js"
], ],
"css": [ "css": [
"/build/admin.4d653142.css" "/build/admin.4d653142.css"
......
{ {
"build/admin.css": "/build/admin.4d653142.css", "build/admin.css": "/build/admin.4d653142.css",
"build/admin.js": "/build/admin.3024c297.js", "build/admin.js": "/build/admin.f9a92453.js",
"build/app.css": "/build/app.0ecb0d81.css", "build/app.css": "/build/app.4ada5381.css",
"build/app.js": "/build/app.a1cf5950.js", "build/app.js": "/build/app.50959599.js",
"build/runtime.js": "/build/runtime.420770e4.js", "build/runtime.js": "/build/runtime.420770e4.js",
"build/ckeditor/adapters/jquery.js": "/build/ckeditor/adapters/jquery.js", "build/ckeditor/adapters/jquery.js": "/build/ckeditor/adapters/jquery.js",
"build/ckeditor/ckeditor.js": "/build/ckeditor/ckeditor.js", "build/ckeditor/ckeditor.js": "/build/ckeditor/ckeditor.js",
......
...@@ -6,6 +6,9 @@ ...@@ -6,6 +6,9 @@
<h5 class="modal-title" id="confirmTransactionModalTitle">{{ 'Vous allez effectuer une transaction'|trans }}</h5> <h5 class="modal-title" id="confirmTransactionModalTitle">{{ 'Vous allez effectuer une transaction'|trans }}</h5>
</div> </div>
<div class="modal-body"> <div class="modal-body">
<div class="confirmTransfertPrestataireComptoir" style="display:none;">
<p>{{ 'Vous vous apprêtez à effectuer un dépôt sur le comptoir, déchargeant le prestataire'|trans }} <b><span class="nom_destinataire"></span></b> {{ 'de'|trans }} <b><span class="montant_transaction"></span> {{ 'eMLC'|trans }}</b>.</p>
</div>
<div class="confirmTransactionPrestataire" style="display:none;"> <div class="confirmTransactionPrestataire" style="display:none;">
<p>{{ 'Vous vous apprêtez à effectuer une transaction au prestataire'|trans }} <b><span class="nom_destinataire"></span></b> {{ 'd\'une valeur de'|trans }} <b><span class="montant_transaction"></span> {{ 'eMLC'|trans }}</b>.</p> <p>{{ 'Vous vous apprêtez à effectuer une transaction au prestataire'|trans }} <b><span class="nom_destinataire"></span></b> {{ 'd\'une valeur de'|trans }} <b><span class="montant_transaction"></span> {{ 'eMLC'|trans }}</b>.</p>
</div> </div>
......
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