From e0085417df71c69414cf90895e106bb13c34c4db Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Mon, 6 Feb 2023 07:11:05 +0300 Subject: [PATCH 1/3] Init bundle controller --- Controllers/BundleController.cs | 18 ++++++++++++++++++ Views/Bundle/Show.cshtml | 14 ++++++++++++++ Views/Home/Index.cshtml | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 Controllers/BundleController.cs create mode 100644 Views/Bundle/Show.cshtml diff --git a/Controllers/BundleController.cs b/Controllers/BundleController.cs new file mode 100644 index 0000000..8ec1030 --- /dev/null +++ b/Controllers/BundleController.cs @@ -0,0 +1,18 @@ +using Microsoft.AspNetCore.Mvc; +using MyDarling.Models; + +namespace MyDarling.Controllers +{ + public class BundleController : Controller + { + private DataContext context; + public BundleController(DataContext context) + { + this.context = context; + } + public async Task Show(int id) + { + return View(await context.UnderwearBundles.FindAsync(id)); + } + } +} \ No newline at end of file diff --git a/Views/Bundle/Show.cshtml b/Views/Bundle/Show.cshtml new file mode 100644 index 0000000..8d3e055 --- /dev/null +++ b/Views/Bundle/Show.cshtml @@ -0,0 +1,14 @@ + + + + + + @Model?.Name + + + +

@Model?.Name

+

@Model?.Description

+ + + diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 8149c41..5a368de 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -72,7 +72,7 @@ {
- ... + ...
@bundle.Name
From 29478524c7aa12b0d95ebbc4b8b168119c9557c4 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Mon, 6 Feb 2023 21:32:40 +0300 Subject: [PATCH 2/3] Add base carousel --- Controllers/BundleController.cs | 5 +- Views/Bundle/Show.cshtml | 76 ++++++-- Views/Home/Index.cshtml | 324 +++++++++++++++----------------- Views/Shared/_Layout.cshtml | 26 +++ libman.json | 7 +- 5 files changed, 242 insertions(+), 196 deletions(-) create mode 100644 Views/Shared/_Layout.cshtml diff --git a/Controllers/BundleController.cs b/Controllers/BundleController.cs index 8ec1030..d8d2512 100644 --- a/Controllers/BundleController.cs +++ b/Controllers/BundleController.cs @@ -1,4 +1,5 @@ using Microsoft.AspNetCore.Mvc; +using Microsoft.EntityFrameworkCore; using MyDarling.Models; namespace MyDarling.Controllers @@ -10,9 +11,9 @@ namespace MyDarling.Controllers { this.context = context; } - public async Task Show(int id) + public IActionResult Show(int id) { - return View(await context.UnderwearBundles.FindAsync(id)); + return View(context.UnderwearBundles.Include(x => x.Figures).Where(x => x.Id == id).FirstOrDefault()); } } } \ No newline at end of file diff --git a/Views/Bundle/Show.cshtml b/Views/Bundle/Show.cshtml index 8d3e055..fe6ce88 100644 --- a/Views/Bundle/Show.cshtml +++ b/Views/Bundle/Show.cshtml @@ -1,14 +1,62 @@ - - - - - - @Model?.Name - - - -

@Model?.Name

-

@Model?.Description

- - - +@model MyDarling.Models.UnderwearBundle; +@{ + Layout = "_Layout"; +} + +
+
+
+
+ +
+
+

@Model?.Name

+

@Model?.Description

+
+
+
+
\ No newline at end of file diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 5a368de..5cc07f3 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -1,192 +1,168 @@ @model IQueryable; - - - - - - - - - - Grayscale - Start Bootstrap Theme - - - - - - - - - -
-
-
-
-

Grayscale

-

A free, responsive, one page Bootstrap theme created by - Start Bootstrap.

- Get Started -
+
+ + +
+
+
+
+

Built with Bootstrap 5

+

+ Grayscale is a free Bootstrap theme created by Start Bootstrap. It can be yours right now, + simply download the template on + the preview page. + The theme is open source, and you can use it for any purpose, personal or commercial. +

-
- -
-
-
-
-

Built with Bootstrap 5

-

- Grayscale is a free Bootstrap theme created by Start Bootstrap. It can be yours right now, - simply download the template on - the preview page. - The theme is open source, and you can use it for any purpose, personal or commercial. -

-
-
- ... -
-
- -
-
-
- @foreach (var bundle in @Model) - { -
-
- ... -
-
-
@bundle.Name
- @bundle.Price.ToString("c0") -
+ ... +
+
+ +
+
+
+ @foreach (var bundle in @Model) + { +
+
+ ... +
+
+
@bundle.Name
+ @bundle.Price.ToString("c0")
- } -
-
-
- - - -
-
-
-
-
-
- -

Address

-
-
4923 Market Street, Orlando FL
+
+
+ + + +
+
+
+
+
+
+ +

Address

+
+
4923 Market Street, Orlando FL
- -
- -
-
Copyright © Your Website 2022
-
- - - - - - - \ No newline at end of file + +
+ \ No newline at end of file diff --git a/Views/Shared/_Layout.cshtml b/Views/Shared/_Layout.cshtml new file mode 100644 index 0000000..e685f8d --- /dev/null +++ b/Views/Shared/_Layout.cshtml @@ -0,0 +1,26 @@ + + + + + + + + + Grayscale - Start Bootstrap Theme + + + + + + + @RenderBody() +
+
© My Darling underwear 2023
+
+ + + + + + + \ No newline at end of file diff --git a/libman.json b/libman.json index c15368e..ceee271 100644 --- a/libman.json +++ b/libman.json @@ -1,10 +1,5 @@ { "version": "1.0", "defaultProvider": "cdnjs", - "libraries": [ - { - "library": "bootstrap@5.2.3", - "destination": "wwwroot/lib/bootstrap" - } - ] + "libraries": [] } \ No newline at end of file From 189a5fa7010fce2982b7f7d8672e8d2c12ae99b8 Mon Sep 17 00:00:00 2001 From: Sergey Chebotar Date: Tue, 7 Feb 2023 07:31:27 +0300 Subject: [PATCH 3/3] Add anchor tag helper --- Views/Home/Index.cshtml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/Views/Home/Index.cshtml b/Views/Home/Index.cshtml index 5cc07f3..2d3a4b4 100644 --- a/Views/Home/Index.cshtml +++ b/Views/Home/Index.cshtml @@ -1,4 +1,6 @@ @model IQueryable; +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers + @{ Layout = "_Layout"; } @@ -58,7 +60,7 @@ {
- ...