summaryrefslogtreecommitdiff
path: root/Pages/Shared/_Projects.cshtml
diff options
context:
space:
mode:
authorSergey Chebotar <s.chebotar@gmail.com>2023-05-30 07:18:47 +0300
committerSergey Chebotar <s.chebotar@gmail.com>2023-05-30 07:30:44 +0300
commit81c1fc0c14253457c3c4fc24735e787ace1db70b (patch)
treefed58558300250876657fe6f9b0880af6d11f9f0 /Pages/Shared/_Projects.cshtml
parent55b30fc75acb554770dc171b5ea54ad821b81d00 (diff)
Add index razor page
Diffstat (limited to 'Pages/Shared/_Projects.cshtml')
-rw-r--r--Pages/Shared/_Projects.cshtml39
1 files changed, 39 insertions, 0 deletions
diff --git a/Pages/Shared/_Projects.cshtml b/Pages/Shared/_Projects.cshtml
new file mode 100644
index 0000000..4b9a62e
--- /dev/null
+++ b/Pages/Shared/_Projects.cshtml
@@ -0,0 +1,39 @@
+@using System.Globalization
+@using Microsoft.EntityFrameworkCore
+@using MyDarling.Models
+@inject DataContext context
+
+@{
+ var bundles = context.UnderwearBundles
+ .Include(b => b.Figures)
+ .Where(b => b.Price != 0 && b.Figures.Count > 0)
+ .OrderByDescending(b => b.Id);
+}
+
+<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 bundles)
+ {
+ <div class="col mb-5">
+ <div class="card h-100">
+ <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"
+ data-caption="@bundle.Figures[i].Description"></a>
+ }
+ <div class="card-body p-4">
+ <div class="text-center">
+ <h5 class="fw-bolder">@bundle.Name</h5>
+ @String.Format(new CultureInfo("ru-RU"), "{0:C0}", @bundle.Price)
+ </div>
+ </div>
+ </div>
+ </div>
+ }
+ </div>
+ </div>
+</section> \ No newline at end of file