0
0

Add base carousel

This commit is contained in:
Sergey Chebotar 2023-02-06 21:32:40 +03:00
parent e0085417df
commit 29478524c7
5 changed files with 242 additions and 196 deletions

View File

@ -1,4 +1,5 @@
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
using Microsoft.EntityFrameworkCore;
using MyDarling.Models; using MyDarling.Models;
namespace MyDarling.Controllers namespace MyDarling.Controllers
@ -10,9 +11,9 @@ namespace MyDarling.Controllers
{ {
this.context = context; this.context = context;
} }
public async Task<IActionResult> 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());
} }
} }
} }

View File

@ -1,14 +1,62 @@
<!DOCTYPE html> @model MyDarling.Models.UnderwearBundle;
@{
<html> Layout = "_Layout";
}
<head> <nav class="navbar navbar-expand-lg navbar-dark fixed-top bg-black" id="mainNav">
<title>@Model?.Name</title> <div class="container px-4 px-lg-5">
</head> <a class="navbar-brand" href="/"><img height="40" src="/assets/img/logo.svg"></a>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
<body> data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
<p>@Model?.Name</p> aria-label="Toggle navigation">
<p>@Model?.Description</p> Menu
</body> <i class="fas fa-bars"></i>
</button>
</html> <div class="collapse navbar-collapse" id="navbarResponsive">
<ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="/Home/Index#about">About</a></li>
<li class="nav-item"><a class="nav-link" href="/Home/Index#projects">Projects</a></li>
<li class="nav-item"><a class="nav-link" href="/Home/Index#signup">Contact</a></li>
</ul>
</div>
</div>
</nav>
<section class="projects-section bg-light">
<div class="container px-3 px-lg-4 mt-4">
<div class="row gx-4 gx-lg-5 justify-content-center ">
<div class="col-md">
<div id="carouselIndicators" class="carousel slide" data-ride="carousel">
<ol class="carousel-indicators">
<li data-target="#carouselIndicators" data-slide-to="0" class="active"></li>
@for (int i = 1; i < @Model?.Figures.Count(); i++)
{
<li data-target="#carouselIndicators" data-slide-to="@i"></li>
}
</ol>
<div class="carousel-inner">
<div class="carousel-item active">
<img class="d-block w-100" src="@Model?.Figures[0].FilePath" alt="...">
</div>
@for (int i = 1; i < @Model?.Figures.Count(); i++)
{
<div class="carousel-item">
<img class="d-block w-100" src="@Model?.Figures[i].FilePath" alt="...">
</div>
}
</div>
<a class="carousel-control-prev" href="#carouselIndicators" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="carousel-control-next" href="#carouselIndicators" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
</div>
<div class="col-md">
<h1 class="mb-4">@Model?.Name</h1>
<p class="projects-section">@Model?.Description</p>
</div>
</div>
</div>
</section>

View File

@ -1,192 +1,168 @@
@model IQueryable<MyDarling.Models.UnderwearBundle>; @model IQueryable<MyDarling.Models.UnderwearBundle>;
@{
<!DOCTYPE html> Layout = "_Layout";
<html lang="ru-RU"> }
<nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav">
<head> <div class="container px-4 px-lg-5">
<meta charset="utf-8" /> <a class="navbar-brand" href="#page-top"><img height="40" src="/assets/img/logo.svg"></a>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" /> <button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse"
<meta name="description" content="" /> data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false"
<meta name="author" content="" /> aria-label="Toggle navigation">
<title>Grayscale - Start Bootstrap Theme</title> Menu
<link rel="icon" type="image/x-icon" href="assets/favicon.ico" /> <i class="fas fa-bars"></i>
<script src="https://use.fontawesome.com/releases/v6.1.0/js/all.js" crossorigin="anonymous"></script> </button>
<link href="/css/styles.css" rel="stylesheet" /> <div class="collapse navbar-collapse" id="navbarResponsive">
</head> <ul class="navbar-nav ms-auto">
<li class="nav-item"><a class="nav-link" href="/Home/Index#about">About</a></li>
<body id="page-top"> <li class="nav-item"><a class="nav-link" href="/Home/Index#projects">Projects</a></li>
<!-- Navigation--> <li class="nav-item"><a class="nav-link" href="/Home/Index#signup">Contact</a></li>
<nav class="navbar navbar-expand-lg navbar-dark fixed-top" id="mainNav"> </ul>
<div class="container px-4 px-lg-5"> </div>
<a class="navbar-brand" href="#page-top"><img height="40" src="assets/img/logo.svg"></a> </div>
<button class="navbar-toggler navbar-toggler-right" type="button" data-bs-toggle="collapse" </nav>
data-bs-target="#navbarResponsive" aria-controls="navbarResponsive" aria-expanded="false" <!-- Masthead-->
aria-label="Toggle navigation"> <section class="masthead">
Menu <div class="container px-4 px-lg-5 d-flex h-100 align-items-center justify-content-center">
<i class="fas fa-bars"></i> <div class="d-flex justify-content-center">
</button> <div class="text-center">
<div class="collapse navbar-collapse" id="navbarResponsive"> <h1 class="mx-auto my-0 text-uppercase">Grayscale</h1>
<ul class="navbar-nav ms-auto"> <h2 class="text-white-50 mx-auto mt-2 mb-5">A free, responsive, one page Bootstrap theme created by
<li class="nav-item"><a class="nav-link" href="#about">About</a></li> Start Bootstrap.</h2>
<li class="nav-item"><a class="nav-link" href="#projects">Projects</a></li> <a class="btn btn-primary" href="#about">Get Started</a>
<li class="nav-item"><a class="nav-link" href="#signup">Contact</a></li>
</ul>
</div> </div>
</div> </div>
</nav> </div>
<!-- Masthead--> </section>
<header class="masthead"> <!-- About-->
<div class="container px-4 px-lg-5 d-flex h-100 align-items-center justify-content-center"> <section class="about-section text-center" id="about">
<div class="d-flex justify-content-center"> <div class="container px-4 px-lg-5">
<div class="text-center"> <div class="row gx-4 gx-lg-5 justify-content-center">
<h1 class="mx-auto my-0 text-uppercase">Grayscale</h1> <div class="col-lg-8">
<h2 class="text-white-50 mx-auto mt-2 mb-5">A free, responsive, one page Bootstrap theme created by <h2 class="text-white mb-4">Built with Bootstrap 5</h2>
Start Bootstrap.</h2> <p class="text-white-50">
<a class="btn btn-primary" href="#about">Get Started</a> Grayscale is a free Bootstrap theme created by Start Bootstrap. It can be yours right now,
</div> simply download the template on
<a href="https://startbootstrap.com/theme/grayscale/">the preview page.</a>
The theme is open source, and you can use it for any purpose, personal or commercial.
</p>
</div> </div>
</div> </div>
</header> <img class="img-fluid" src="assets/img/ipad.png" alt="..." />
<!-- About--> </div>
<section class="about-section text-center" id="about"> </section>
<div class="container px-4 px-lg-5"> <!-- Projects-->
<div class="row gx-4 gx-lg-5 justify-content-center"> <section class="projects-section bg-light" id="projects">
<div class="col-lg-8"> <div class="container px-3 px-lg-4 mt-4">
<h2 class="text-white mb-4">Built with Bootstrap 5</h2> <div class="row gx-4 gx-lg-5 row-cols-2 row-cols-md-3 row-cols-xl-4 justify-content-center">
<p class="text-white-50"> @foreach (var bundle in @Model)
Grayscale is a free Bootstrap theme created by Start Bootstrap. It can be yours right now, {
simply download the template on <div class="col mb-5">
<a href="https://startbootstrap.com/theme/grayscale/">the preview page.</a> <div class="card h-100">
The theme is open source, and you can use it for any purpose, personal or commercial. <a href="/bundle/show/@bundle.Id"><img class="card-img-top"
</p> src="@bundle.Figures.FirstOrDefault()?.FilePath" alt="..." /></a>
</div> <div class="card-body p-4">
</div> <div class="text-center">
<img class="img-fluid" src="assets/img/ipad.png" alt="..." /> <h5 class="fw-bolder">@bundle.Name</h5>
</div> @bundle.Price.ToString("c0")
</section>
<!-- Projects-->
<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)
{
<div class="col mb-5">
<div class="card h-100">
<a href="/bundle/show/@bundle.Id"><img class="card-img-top" src="@bundle.Figures.FirstOrDefault()?.FilePath" alt="..." /></a>
<div class="card-body p-4">
<div class="text-center">
<h5 class="fw-bolder">@bundle.Name</h5>
@bundle.Price.ToString("c0")
</div>
</div> </div>
</div> </div>
</div> </div>
}
</div>
</div>
</section>
<!-- Signup-->
<section class="signup-section" id="signup">
<div class="container px-4 px-lg-5">
<div class="row gx-4 gx-lg-5">
<div class="col-md-10 col-lg-8 mx-auto text-center">
<i class="far fa-paper-plane fa-2x mb-2 text-white"></i>
<h2 class="text-white mb-5">Subscribe to receive updates!</h2>
<!-- * * * * * * * * * * * * * * *-->
<!-- * * SB Forms Contact Form * *-->
<!-- * * * * * * * * * * * * * * *-->
<!-- This form is pre-integrated with SB Forms.-->
<!-- To make this form functional, sign up at-->
<!-- https://startbootstrap.com/solution/contact-forms-->
<!-- to get an API token!-->
<form class="form-signup" id="contactForm" data-sb-form-api-token="API_TOKEN">
<!-- Email address input-->
<div class="row input-group-newsletter">
<div class="col"><input class="form-control" id="emailAddress" type="email"
placeholder="Enter email address..." aria-label="Enter email address..."
data-sb-validations="required,email" /></div>
<div class="col-auto"><button class="btn btn-primary disabled" id="submitButton"
type="submit">Notify Me!</button></div>
</div>
<div class="invalid-feedback mt-2" data-sb-feedback="emailAddress:required">An email is
required.</div>
<div class="invalid-feedback mt-2" data-sb-feedback="emailAddress:email">Email is not valid.
</div>
<!-- Submit success message-->
<!---->
<!-- This is what your users will see when the form-->
<!-- has successfully submitted-->
<div class="d-none" id="submitSuccessMessage">
<div class="text-center mb-3 mt-2 text-white">
<div class="fw-bolder">Form submission successful!</div>
To activate this form, sign up at
<br />
<a
href="https://startbootstrap.com/solution/contact-forms">https://startbootstrap.com/solution/contact-forms</a>
</div>
</div>
<!-- Submit error message-->
<!---->
<!-- This is what your users will see when there is-->
<!-- an error submitting the form-->
<div class="d-none" id="submitErrorMessage">
<div class="text-center text-danger mb-3 mt-2">Error sending message!</div>
</div>
</form>
</div> </div>
</div> }
</div> </div>
</section> </div>
<!-- Contact--> </section>
<section class="contact-section bg-black"> <!-- Signup-->
<div class="container px-4 px-lg-5"> <section class="signup-section" id="signup">
<div class="row gx-4 gx-lg-5"> <div class="container px-4 px-lg-5">
<div class="col-md-4 mb-3 mb-md-0"> <div class="row gx-4 gx-lg-5">
<div class="card py-4 h-100"> <div class="col-md-10 col-lg-8 mx-auto text-center">
<div class="card-body text-center"> <i class="far fa-paper-plane fa-2x mb-2 text-white"></i>
<i class="fas fa-map-marked-alt text-primary mb-2"></i> <h2 class="text-white mb-5">Subscribe to receive updates!</h2>
<h4 class="text-uppercase m-0">Address</h4> <!-- * * * * * * * * * * * * * * *-->
<hr class="my-4 mx-auto" /> <!-- * * SB Forms Contact Form * *-->
<div class="small text-black-50">4923 Market Street, Orlando FL</div> <!-- * * * * * * * * * * * * * * *-->
<!-- This form is pre-integrated with SB Forms.-->
<!-- To make this form functional, sign up at-->
<!-- https://startbootstrap.com/solution/contact-forms-->
<!-- to get an API token!-->
<form class="form-signup" id="contactForm" data-sb-form-api-token="API_TOKEN">
<!-- Email address input-->
<div class="row input-group-newsletter">
<div class="col"><input class="form-control" id="emailAddress" type="email"
placeholder="Enter email address..." aria-label="Enter email address..."
data-sb-validations="required,email" /></div>
<div class="col-auto"><button class="btn btn-primary disabled" id="submitButton"
type="submit">Notify Me!</button></div>
</div>
<div class="invalid-feedback mt-2" data-sb-feedback="emailAddress:required">An email is
required.</div>
<div class="invalid-feedback mt-2" data-sb-feedback="emailAddress:email">Email is not valid.
</div>
<!-- Submit success message-->
<!---->
<!-- This is what your users will see when the form-->
<!-- has successfully submitted-->
<div class="d-none" id="submitSuccessMessage">
<div class="text-center mb-3 mt-2 text-white">
<div class="fw-bolder">Form submission successful!</div>
To activate this form, sign up at
<br />
<a
href="https://startbootstrap.com/solution/contact-forms">https://startbootstrap.com/solution/contact-forms</a>
</div> </div>
</div> </div>
</div> <!-- Submit error message-->
<div class="col-md-4 mb-3 mb-md-0"> <!---->
<div class="card py-4 h-100"> <!-- This is what your users will see when there is-->
<div class="card-body text-center"> <!-- an error submitting the form-->
<i class="fas fa-envelope text-primary mb-2"></i> <div class="d-none" id="submitErrorMessage">
<h4 class="text-uppercase m-0">Email</h4> <div class="text-center text-danger mb-3 mt-2">Error sending message!</div>
<hr class="my-4 mx-auto" />
<div class="small text-black-50"><a href="#!">hello@yourdomain.com</a></div>
</div>
</div> </div>
</div> </form>
<div class="col-md-4 mb-3 mb-md-0"> </div>
<div class="card py-4 h-100"> </div>
<div class="card-body text-center"> </div>
<i class="fas fa-mobile-alt text-primary mb-2"></i> </section>
<h4 class="text-uppercase m-0">Phone</h4> <!-- Contact-->
<hr class="my-4 mx-auto" /> <section class="contact-section bg-black">
<div class="small text-black-50">+1 (555) 902-8832</div> <div class="container px-4 px-lg-5">
</div> <div class="row gx-4 gx-lg-5">
<div class="col-md-4 mb-3 mb-md-0">
<div class="card py-4 h-100">
<div class="card-body text-center">
<i class="fas fa-map-marked-alt text-primary mb-2"></i>
<h4 class="text-uppercase m-0">Address</h4>
<hr class="my-4 mx-auto" />
<div class="small text-black-50">4923 Market Street, Orlando FL</div>
</div> </div>
</div> </div>
</div> </div>
<div class="social d-flex justify-content-center"> <div class="col-md-4 mb-3 mb-md-0">
<a class="mx-2" href="#!"><i class="fab fa-twitter"></i></a> <div class="card py-4 h-100">
<a class="mx-2" href="#!"><i class="fab fa-facebook-f"></i></a> <div class="card-body text-center">
<a class="mx-2" href="#!"><i class="fab fa-github"></i></a> <i class="fas fa-envelope text-primary mb-2"></i>
<h4 class="text-uppercase m-0">Email</h4>
<hr class="my-4 mx-auto" />
<div class="small text-black-50"><a href="#!">hello@yourdomain.com</a></div>
</div>
</div>
</div>
<div class="col-md-4 mb-3 mb-md-0">
<div class="card py-4 h-100">
<div class="card-body text-center">
<i class="fas fa-mobile-alt text-primary mb-2"></i>
<h4 class="text-uppercase m-0">Phone</h4>
<hr class="my-4 mx-auto" />
<div class="small text-black-50">+1 (555) 902-8832</div>
</div>
</div>
</div> </div>
</div> </div>
</section> <div class="social d-flex justify-content-center">
<!-- Footer--> <a class="mx-2" href="#!"><i class="fab fa-twitter"></i></a>
<footer class="footer bg-black small text-center text-white-50"> <a class="mx-2" href="#!"><i class="fab fa-facebook-f"></i></a>
<div class="container px-4 px-lg-5">Copyright &copy; Your Website 2022</div> <a class="mx-2" href="#!"><i class="fab fa-github"></i></a>
</footer> </div>
<!-- Bootstrap core JS--> </div>
<script src="/lib/bootstrap/js/bootstrap.bundle.min.js"></script> </section>
<!-- Core theme JS-->
<script src="/js/scripts.js"></script>
</body>
</html>

View File

@ -0,0 +1,26 @@
<!DOCTYPE html>
<html lang="ru-RU">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content="" />
<meta name="author" content="" />
<title>Grayscale - Start Bootstrap Theme</title>
<link rel="icon" type="image/x-icon" href="/assets/favicon.ico" />
<script src="https://use.fontawesome.com/releases/v6.1.0/js/all.js" crossorigin="anonymous"></script>
<link href="/css/styles.css" rel="stylesheet" />
</head>
<body id="page-top">
@RenderBody()
<footer class="footer bg-black small text-center text-white-50">
<div class="container px-4 px-lg-5">&copy; My Darling underwear 2023</div>
</footer>
<script src="/js/scripts.js"></script>
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/popper.js@1.14.7/dist/umd/popper.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.3.1/dist/js/bootstrap.min.js"></script>
</body>
</html>

View File

@ -1,10 +1,5 @@
{ {
"version": "1.0", "version": "1.0",
"defaultProvider": "cdnjs", "defaultProvider": "cdnjs",
"libraries": [ "libraries": []
{
"library": "bootstrap@5.2.3",
"destination": "wwwroot/lib/bootstrap"
}
]
} }