From 40bb43fc35627ac8929616ffd8d0fa94eea565bb Mon Sep 17 00:00:00 2001 From: soufiane Date: Mon, 22 Apr 2024 18:02:57 +0200 Subject: [PATCH] wip #6867 @2:30 --- .../fluidbook.cart.bastide-resah-guest.js | 29 ++++++++++++------- style/cart/bastide-resah.less | 16 +++++++++- 2 files changed, 33 insertions(+), 12 deletions(-) diff --git a/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah-guest.js b/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah-guest.js index be408cd7..006c8e26 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah-guest.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.bastide-resah-guest.js @@ -16,7 +16,7 @@ FluidbookCartBastideResahGuest.prototype = { $(document).on(this.fluidbook.input.clickEvent, '#create-account', function () { $this.updateTitle('Créer un compte') $this.updateCart('register') - $this.updateRegisterClass() + $this.updateDataContent() }); $(document).on("submit", '#Bastide_register_form', function (e) { @@ -42,8 +42,9 @@ FluidbookCartBastideResahGuest.prototype = { $(this.fluidbook).trigger('fluidbook.cart.updateIcon', {number: this.getItemCount()}); }, - updateRegisterClass: function () { - $("#Bastide_cart").toggleClass('register') + updateDataContent: function () { + let dataContent = $("#Bastide_auth_form").find('[data-content]').data('content') + $("#Bastide_cart").attr('data-content',dataContent) }, updateTitle: function(title = "Connexion") { @@ -51,7 +52,7 @@ FluidbookCartBastideResahGuest.prototype = { }, openModal: function (title, content, callback) { - let view = `
+ let view = `
${this.fluidbook.menu.getCaption(title)}
${content} @@ -67,17 +68,17 @@ FluidbookCartBastideResahGuest.prototype = { }, openCart: function (p2, callback) { - this.updateRegisterClass() this.openModal('Connexion', this.getCartContent(), function () { callback(); }); + this.updateDataContent() }, getCartContent: function (action = null) { let form = `
`; switch (action) { case 'register': - form += `
+ form += `
établissement hospitalier @@ -117,7 +118,7 @@ FluidbookCartBastideResahGuest.prototype = {
- +
@@ -125,7 +126,7 @@ FluidbookCartBastideResahGuest.prototype = {
- +
@@ -139,13 +140,15 @@ FluidbookCartBastideResahGuest.prototype = { ` break; - case 'register_ok': `

Votre demande de création de compte sera examinée dans les plus brefs délais. + case 'register_ok': + form += `

Votre demande de création de compte sera examinée dans les plus brefs délais. Vous recevrez un email de confirmation dans les 24h (pensez à vérifier votre dossier spam).

Nos équipes commerciales se tiennent à votre disposition : resah@bastide-medical.fr

` + break; default: - form += `
+ form += `

Pour afficher les tarifs, ajouter des produits à votre sélection, et nous envoyer une demande de devis, veuillez vous identifier :

@@ -186,15 +189,19 @@ FluidbookCartBastideResahGuest.prototype = { success: function(data) { $this.updateTitle('Merci !') $this.updateCart('register_ok') + $this.updateDataContent() }, error: function(xhr, status, error) { - console.log(xhr, error) let errorsMessage = JSON.parse(xhr.responseText); $this.displayErrors(errorsMessage) } }); }, + login: function() { + + }, + displayErrors: function(errors) { console.log(errors['errors'],"ok") $(".errors-container").remove() diff --git a/style/cart/bastide-resah.less b/style/cart/bastide-resah.less index db4307b3..3522e7a8 100644 --- a/style/cart/bastide-resah.less +++ b/style/cart/bastide-resah.less @@ -46,10 +46,14 @@ } - &.register { + &[data-content="register"] { max-width: 600px; } + &[data-content="register_ok"] { + min-height: auto; + } + .caption { padding: 25px 30px 35px; height: auto; @@ -599,6 +603,16 @@ } } } + + #Bastide_notif_form { + p:not(:last-child) { + margin-bottom: 20px; + } + a { + text-decoration: underline; + color: @menu-background; + } + } } -- 2.39.5