diff options
author | Sergey Chebotar <s.chebotar@gmail.com> | 2023-03-02 07:28:22 +0300 |
---|---|---|
committer | Sergey Chebotar <s.chebotar@gmail.com> | 2023-03-02 07:28:22 +0300 |
commit | 607d029030baa11f890af7b948b129c0ec975905 (patch) | |
tree | 6872dff56d4f62df30c8fb0430ad660953f03f1b /Views/Home | |
parent | 6cb87f6c78d774d7179edceb2c8305ca42a257c1 (diff) |
Base figure adding
Diffstat (limited to 'Views/Home')
-rw-r--r-- | Views/Home/_Projects.cshtml | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/Views/Home/_Projects.cshtml b/Views/Home/_Projects.cshtml index 2cb439d..1eb67bc 100644 --- a/Views/Home/_Projects.cshtml +++ b/Views/Home/_Projects.cshtml @@ -4,13 +4,14 @@ <section class="projects-section bg-light" id="projects"> <div class="container px-3 px-lg-4 mt-4"> <div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center"> - @foreach (var bundle in @Model.Where(b => b.Price != 0)) + @foreach (var bundle in @Model.Where(b => b.Price != 0 && b.Figures.Count > 0) + .OrderByDescending(b => b.Id)) { <div class="col mb-5"> <div class="card h-100"> - <a data-src="@bundle.Figures.FirstOrDefault()?.FilePath" data-fancybox="@bundle.Id" - data-caption="@bundle.Figures.FirstOrDefault()?.Description"><img class="card-img-top" - src="@bundle.Figures.FirstOrDefault()?.FilePath" alt="@bundle.Name" /></a> + <a data-src="@bundle.Figures[0].FilePath" data-fancybox="@bundle.Id" + data-caption="@bundle.Figures[0].Description"><img class="card-img-top" + src="@bundle.Figures[0].FilePath" alt="@bundle.Name" /></a> @for (int i = 1; i < @bundle.Figures.Count(); i++) { <a data-src="@bundle.Figures[i].FilePath" data-fancybox="@bundle.Id" |