From 2402e699fac1f840c28c72b48f42f53c14de5419 Mon Sep 17 00:00:00 2001 From: TheCoreDev Date: Tue, 4 May 2021 16:43:31 +0200 Subject: [PATCH] Recettes : on affiche toujours... --- local/modules/Recettes/Config/routing.xml | 3 ++ local/modules/Recettes/I18n/fr_FR.php | 6 ++-- local/modules/Recettes/Loop/ProductsLoop.php | 3 +- local/modules/Recettes/Loop/StepsLoop.php | 9 +++--- .../default/assets/css/Recettes.css | 23 +++++++++++++- templates/frontOffice/custom/recette.html | 31 ++++++++++++++----- 6 files changed, 60 insertions(+), 15 deletions(-) diff --git a/local/modules/Recettes/Config/routing.xml b/local/modules/Recettes/Config/routing.xml index 8472776c..bfaef7bd 100644 --- a/local/modules/Recettes/Config/routing.xml +++ b/local/modules/Recettes/Config/routing.xml @@ -7,5 +7,8 @@ Recettes\Controller\MainController::saveRecipe + + Recettes\Controller\MainController::addToCart + diff --git a/local/modules/Recettes/I18n/fr_FR.php b/local/modules/Recettes/I18n/fr_FR.php index 0f4ea88d..37739a64 100644 --- a/local/modules/Recettes/I18n/fr_FR.php +++ b/local/modules/Recettes/I18n/fr_FR.php @@ -10,10 +10,12 @@ return array( 'Quantity' => 'Quantité', 'Summary' => 'Description de la recette', 'Other ingredients' => 'Ingrédients supplémentaires', - 'Ingredient' => 'Ingrédient', 'Ingredients' => 'Ingrédients', + 'Ingredient' => 'Nos produits', 'Ingredients from us' => 'Ce que vous pouvez trouver chez nous :', 'Additional ingredients' => 'Vous aurez également besoin de :', 'Quantity needed' => 'Quantité nécessaire', - 'Add to cart' => 'Ajouter à mon panier', + 'Quantity proposed' => 'Quantité proposée', + 'Select' => 'Sélectionner', + 'Add to cart' => 'Ajouter ces produits au panier', ); diff --git a/local/modules/Recettes/Loop/ProductsLoop.php b/local/modules/Recettes/Loop/ProductsLoop.php index 845e4475..dfd3bcdd 100644 --- a/local/modules/Recettes/Loop/ProductsLoop.php +++ b/local/modules/Recettes/Loop/ProductsLoop.php @@ -39,7 +39,8 @@ class ProductsLoop extends BaseLoop implements PropelSearchLoopInterface ->set("RECIPE_ID", $product->getRecipeId()) ->set("PSE_ID", $product->getPseId()) ->set("PRODUCT_LABEL", $productLabel) - ->set("QUANTITY", $product->getQuantity()) + ->set("QUANTITY_NEEDED", $product->getQuantity()) + ->set("QUANTITY_PROPOSED", $product->getNbOfProducts()) ; $loopResult->addRow($loopResultRow); } diff --git a/local/modules/Recettes/Loop/StepsLoop.php b/local/modules/Recettes/Loop/StepsLoop.php index eb908c57..fc07427c 100644 --- a/local/modules/Recettes/Loop/StepsLoop.php +++ b/local/modules/Recettes/Loop/StepsLoop.php @@ -31,9 +31,9 @@ class StepsLoop extends BaseLoop implements PropelSearchLoopInterface $loopResultRow = new LoopResultRow($step); $loopResultRow - ->set("RECIPE_ID", $step->getId()) - ->set("STEP", $step->getContentId()) - ->set("DESCRIPTION", $step->getTitle()) + ->set("RECIPE_ID", $step->getRecipeId()) + ->set("STEP", $step->getStep()) + ->set("DESCRIPTION", $step->getDescription()) ; $loopResult->addRow($loopResultRow); } @@ -58,8 +58,9 @@ class StepsLoop extends BaseLoop implements PropelSearchLoopInterface $steps = RecipeStepsQuery::create(); if (null != $id = $this->getRecipeId()) { - $steps->filterById($id); + $steps->filterByRecipeId($id); } + $steps->orderByStep(); return $steps; } 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 f6f92dff..cfc0d375 100644 --- a/local/modules/Recettes/templates/frontOffice/default/assets/css/Recettes.css +++ b/local/modules/Recettes/templates/frontOffice/default/assets/css/Recettes.css @@ -1,5 +1,5 @@ article#recette { - width: 90% !important; + width: 95% !important; text-align: center; display: flex; flex-direction: column; @@ -35,6 +35,7 @@ div.entete span b { width: 250px; box-shadow: 10px 10px 15px gray; border-radius: 5px; + transform: rotate(-2deg); } .recette-titre { @@ -54,8 +55,28 @@ div.entete span b { .table-ingredients { width: 90%; + margin: auto; } .table-ingredients th, .table-ingredients td { + vertical-align: center !important; text-align: center; + white-space: nowrap; } +.cellule-large { + width: 40%; +} +.cellule-etroite { + width: 1%; +} + +.table-steps { + width: 80%; + margin: auto; +} +.table-steps td.number{ + background-color: #95c11e; + border-radius: 30px; + color: white; + font-weight: bold; +} \ No newline at end of file diff --git a/templates/frontOffice/custom/recette.html b/templates/frontOffice/custom/recette.html index 70ee1ec4..a0926fea 100644 --- a/templates/frontOffice/custom/recette.html +++ b/templates/frontOffice/custom/recette.html @@ -45,6 +45,7 @@ {intl l='Difficulty' d='recettes'}Difficulty{$label_difficulty}
+
{loop type="image" name="image-loop" content=$content_id visible=true} @@ -58,16 +59,22 @@ {intl l="Ingredient" d="recettes"} {intl l="Quantity needed" d="recettes"} - {intl l="Add to cart" d="recettes"} + {intl l="Quantity proposed" d="recettes"} + {intl l="Select" d="recettes"} {loop type="recipe_products" name="products-loop" recipe_id=$ID} - {$PRODUCT_LABEL} - {$QUANTITY} - + {$PRODUCT_LABEL} + {$QUANTITY_NEEDED} + {$QUANTITY_PROPOSED} + {/loop} + + + +
@@ -75,12 +82,22 @@
+

- +
+
+ + {loop type="recipe_steps" name="steps-loop" recipe_id=$ID} + + + + + {/loop} +
{$STEP}{$DESCRIPTION}
+
{/loop} - - +
{/if} {/block}