From db09da198afdd26cfeab2c353fffe62cbc7d21db Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Wed, 5 May 2021 22:37:10 +0200 Subject: [PATCH] Recettes : on finalise la fonction d'impression de la recette --- local/modules/Recettes/I18n/fr_FR.php | 1 + .../default/assets/css/Recettes.css | 13 +++++- templates/frontOffice/custom/recette.html | 46 ++++++++++--------- 3 files changed, 37 insertions(+), 23 deletions(-) diff --git a/local/modules/Recettes/I18n/fr_FR.php b/local/modules/Recettes/I18n/fr_FR.php index 37739a64..45b6b6cd 100644 --- a/local/modules/Recettes/I18n/fr_FR.php +++ b/local/modules/Recettes/I18n/fr_FR.php @@ -18,4 +18,5 @@ return array( 'Quantity proposed' => 'Quantité proposée', 'Select' => 'Sélectionner', 'Add to cart' => 'Ajouter ces produits au panier', + 'Print recipe' => 'Imprimer la recette', ); diff --git a/local/modules/Recettes/templates/frontOffice/default/assets/css/Recettes.css b/local/modules/Recettes/templates/frontOffice/default/assets/css/Recettes.css index 73030cc9..e3c6171c 100644 --- a/local/modules/Recettes/templates/frontOffice/default/assets/css/Recettes.css +++ b/local/modules/Recettes/templates/frontOffice/default/assets/css/Recettes.css @@ -80,5 +80,16 @@ div.entete span b { font-weight: bold; } .bouton-imprimer { + margin: 20px 0; text-align: center; -} \ No newline at end of file +} + +@media print { + .footer-block, + header, + .nav-breadcrumb, + .table-ingredients tr:last-of-type, + #tarteaucitronAlertBig { + display: none !important; + } +} diff --git a/templates/frontOffice/custom/recette.html b/templates/frontOffice/custom/recette.html index c385a9d7..b7c021ea 100644 --- a/templates/frontOffice/custom/recette.html +++ b/templates/frontOffice/custom/recette.html @@ -71,14 +71,14 @@ {/loop} - - - -
- -
- - + + + +
+ +
+ +
@@ -89,21 +89,19 @@

- - {loop type="recipe_steps" name="steps-loop" recipe_id=$ID} - - - - - {/loop} -
{$STEP}{$DESCRIPTION}
- + + {loop type="recipe_steps" name="steps-loop" recipe_id=$ID} + + + + + {/loop} +
{$STEP}{$DESCRIPTION}
{/loop} -
- -
-
+
+ +
{/if} {/block} @@ -123,5 +121,9 @@ } }); + $(".bouton-imprimer button").click(function () { + window.print(); + }); + -{/block} \ No newline at end of file +{/block}