From aa6f27383f4071f06e08ba17943275feb905d7b5 Mon Sep 17 00:00:00 2001 From: franc Date: Wed, 14 May 2025 11:46:48 +0200 Subject: [PATCH] Move the Ingredient List stuff to a Partial view --- .../Views/Recipe/Details.cshtml | 204 +++++++++++++++--- 1 file changed, 171 insertions(+), 33 deletions(-) diff --git a/Francesco.Recipes.World/Views/Recipe/Details.cshtml b/Francesco.Recipes.World/Views/Recipe/Details.cshtml index 4ea25c7..e30b936 100644 --- a/Francesco.Recipes.World/Views/Recipe/Details.cshtml +++ b/Francesco.Recipes.World/Views/Recipe/Details.cshtml @@ -6,7 +6,7 @@

@Model.Name

-
+
@if (Model.MediaFiles.Any() && Model.MediaFiles.First().Data != null) { @@ -20,49 +20,187 @@

Description: @Model.Description

Difficulty: @Model.Difficulty

-

Servings: @Model.Servings

Preparation Time: @Model.PreparationTime

Cooking Time: @Model.CookingTime

-
-

Ingredients

-
-
    - @foreach (var ingredient in Model.RecipeIngredients) - { -
  • - - @ingredient.Ingredient.Name - @ingredient.Quantity @(ingredient.Unit != null ? ingredient.Unit.Symbol : string.Empty) -
  • - } -
- -
-
+ + + + @await Html.PartialAsync("_RecipeInstructionGridPartial", new Francesco.Recipes.World.Models.InstructionViewModel +{ + RecipeId = Model.Id, + Instructions = Model.Instructions.ToList() +}) + +
+ @Html.AntiForgeryToken() + +
@section Scripts { }