From: Vincent Vanwaelscappel Date: Mon, 20 Sep 2021 15:03:38 +0000 (+0200) Subject: wip #4664 @7 X-Git-Url: http://git.cubedesigners.com/?a=commitdiff_plain;h=ffae635ecf5fd230b9f55f0d0c2a858ec049b081;p=fluidbook-html5.git wip #4664 @7 --- diff --git a/js/libs/fluidbook/cart/fluidbook.cart.grandpavois.js b/js/libs/fluidbook/cart/fluidbook.cart.grandpavois.js index e1b38482..afdba425 100644 --- a/js/libs/fluidbook/cart/fluidbook.cart.grandpavois.js +++ b/js/libs/fluidbook/cart/fluidbook.cart.grandpavois.js @@ -92,14 +92,11 @@ FluidbookCartGrandPavois.prototype = { var $this = this; var content = ''; content += ''; - content += ''; content += ''; - content += ''; - content += ''; - content += ''; - content += ''; - content += ''; - content += ''; + content += ''; + content += ''; + content += ''; + content += ''; content += ''; content += ''; content += ''; @@ -108,19 +105,12 @@ FluidbookCartGrandPavois.prototype = { if (item === undefined) { return; } - content += ''; - content += ''; - content += ''; - content += ''; - content += ''; - var image = ''; - if (item.Image) { - image = ''; - } else { - image = '-'; - } - content += ''; - content += ''; + + content += ''; + content += ''; + content += ''; + content += ''; + content += ''; content += ''; content += ''; }); @@ -133,28 +123,54 @@ FluidbookCartGrandPavois.prototype = { return content; }, + getLocalisation: function (item) { + var localisation = []; + if (item['Ponton place'] !== '') { + localisation = localisation.concat(item['Ponton place'].split(';')); + } + if (item['Halls'] !== '') { + localisation = localisation.concat(item['Halls'].split(';')); + } + if (item['Terre plein stand'] !== '') { + localisation = localisation.concat(item['Terre plein stand'].split(';')); + } + var res = []; + $.each(localisation, function (k, v) { + v = v.trim(); + if (res.indexOf(v) === -1) { + res.push(v); + } + }); + return res; + }, + sendCartAsEmail: function () { var $this = this; - var subject = 'Ma liste de Noël' - var body = 'Ma liste de Noël : ' + "\n\n"; + var subject = 'Grand Pavois La Rochelle - Ma visite' + var body = ''; $.each(this.getItems(), function (i, ref) { var item = $this.fluidbook.settings.basketReferences[ref]; if (item === undefined) { return; } - body += item.Produit + ' (' + item.Marque + ') - ' + item.Prix + " :\n"; - body += item.Lien + "\n\n"; + body += item.Exposant; + if (item.Tel) { + body += ' (' + item.Tel + ')'; + } + body += "\n"; + body += item['Activité FR + UK'] + "\n"; + body += $this.getLocalisation(item).join("\n") + "\n\n----\n\n"; }); window.location.href = 'mailto:?subject=' + encodeURIComponent(subject) + '&body=' + encodeURIComponent(body); }, exportPDF: function () { - var element = $('#mifcarttable').get(0); + var element = $('#grandpavoiscartprint').get(0); var options = { - margin: 15, + margin: 5, filename: this.getExportFileName() + '.pdf', image: {type: 'jpeg', quality: 0.98}, html2canvas: {dpi: 150, scale: 2, letterRendering: true}, @@ -172,13 +188,15 @@ FluidbookCartGrandPavois.prototype = { getExportFileName: function () { var date = new Date(); - return this.fluidbook.settings.title + ' - Cart - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay(); + return this.fluidbook.settings.title + ' - Ma Visite - ' + date.getFullYear() + '-' + date.getMonth() + '-' + date.getDay(); }, _endMenu: function (title, content, callback) { - var view = '
'; - view += this.fluidbook.menu.getCaption(title); - view += '
'; + var view = '
'; + view += this.fluidbook.menu.getCaption(); + + view += '
'; + view += '
'; view += "" + content; view += '
'; view += '
'; @@ -187,7 +205,7 @@ FluidbookCartGrandPavois.prototype = { }, getMenuWidth: function () { - return 1200; + return 1060; }, parseFloat: function (s) { diff --git a/style/cart/grandpavois.less b/style/cart/grandpavois.less index dc91e769..720815b5 100644 --- a/style/cart/grandpavois.less +++ b/style/cart/grandpavois.less @@ -1,15 +1,21 @@ -#mifcart { +#grandpavoiscart { + background-color: #f2f2f2; + .caption { - margin-top: 10px; + margin-top: 0px; + padding: 0; + height: 0; text-transform: uppercase; } } +.mview #grandpavoiscart .fonctions a { + background-color: #035d89; +} + [data-type="7"] { svg { pointer-events: none; - - } .on { @@ -31,8 +37,49 @@ } } +#grandpavoiscartprint { + &.print { + font-size: 8px; + + .ps__rail-y, .ps__rail-x { + display: none; + } + + #grandpavoiscarttable { + + span { + text-decoration: none; + } + + margin: 20px 0 0 0; + font-size: 8px; + width: 100%; + + td, th { + vertical-align: top; + padding: 5px; + + &:last-child { + display: none; + } + } + + [data-cart-delete], [data-cart-view] { + display: none; + } + } + + .fonctions { + display: none; + } + } +} + +#grandpavoiscarttable { + img { + width: 1060px; + } -#mifcarttable { [data-cart-delete], [data-cart-view] { color: #fff; background-color: @menu-button-background; @@ -44,72 +91,23 @@ left: 20px; } - [data-cart-view] { - padding: 0; - } - - tr.print-header { - display: none; - font-size: 0; - - td { - padding: 0; - display: table-cell !important; - - img { - max-width: 100%; - } - } - } - padding: 0; border-collapse: collapse; - margin: 20px 30px 40px; + margin: 50px 30px 40px; width: ~"calc(100% - 60px)"; max-width: none; - &.print { - tr.print-header { - display: table-row !important; - } - - span { - text-decoration: none; - } - - margin: 0; - font-size: 8px; - width: 100%; - - td, th { - vertical-align: top; - padding: 5px; - - &:last-child { - display: none; - } - } - - [data-cart-delete], [data-cart-view] { - display: none; - } - } td, th { padding: 20px 0 20px 30px; font-size: 11px; - text-align: center; + text-align: left; span { display: block; - max-width: 120px; white-space: normal; - margin: 0 auto; } - img { - max-width: 80px; - } &:last-child { padding-right: 30px; @@ -121,14 +119,14 @@ th { text-transform: uppercase; color: #fff; - background-color: @menu-button-background; + background-color: #035d89; font-weight: normal; } } tbody { td { - border-top: 1px solid #000; + border-top: 1px solid #f2f2f2; } tr {
CatégorieMarqueNom du produitPrixImageExposantActivitéTéléphoneLocalisation
' + item.Categorie + '' + item.Marque + '' + item.Produit + '' + item.Prix + '' + image + '' + getSpriteIcon('icon-eye') + '
' + item.Exposant + '' + item['Activité FR + UK'] + '' + item.Tel + '' + $this.getLocalisation(item).join('
') + '
' + getSpriteIcon('interface-close') + '