Skip to content

Commit

Permalink
Book Details page updated.
Browse files Browse the repository at this point in the history
  • Loading branch information
aliarmaganuygun committed Oct 15, 2024
1 parent e7f7588 commit 2a5bad3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
8 changes: 6 additions & 2 deletions BulkyWeb/Areas/Customer/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,12 @@ public IActionResult Index()
}
public IActionResult Details(int productId)
{
Product product = _unitOfWork.Product.Get(p=> p.Id == productId,includeProperties: "Category");
return View(product);
ShoppingCart cart = new()
{
Product = _unitOfWork.Product.Get(p => p.Id == productId, includeProperties: "Category"),
ProductId = productId
};
return View(cart);
}

public IActionResult Privacy()
Expand Down
29 changes: 14 additions & 15 deletions BulkyWeb/Areas/Customer/Views/Home/Details.cshtml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
@model Product
@model ShoppingCart

<form method="post">
<div class="card shadow border-0 mt-4 mb-4">
<div class="card-header bg-secondary bg-gradient text-light py-4">
<div class="row">
<div class="col-12 text-center">
<h3 class="text-white text-uppercase">@Model.Title</h3>
<p class="text-white-50 fw-semibold mb-0">by @Model.Author</p>
<h3 class="text-white text-uppercase">@Model.Product.Title</h3>
<p class="text-white-50 fw-semibold mb-0">by @Model.Product.Author</p>
</div>
</div>
</div>
Expand All @@ -21,21 +21,21 @@
</div>
<div class="row">
<div class="col-12 col-lg-3 offset-lg-1 text-center mb-3">
<img src="@Model.ImageUrl" style="width:100%" class="rounded" />
<img src="@Model.Product.ImageUrl" style="width:100%" class="rounded" />
</div>
<div class="col-12 col-lg-6 offset-lg-1">

<div class="col-12 col-md-6 pb-4">
<span class="badge">@Model.Category.Name</span>
<span class="badge">@Model.Product.Category.Name</span>
</div>
<div class="row ps-2">
<h6 class="text-dark text-opacity-50 ">ISBN : @Model.ISBN</h6>
<h6 class="text-dark text-opacity-50 ">ISBN : @Model.Product.ISBN</h6>
</div>
<div class="row ps-2">
<h6 class="text-dark text-opacity-50 pb-2">
List Price:
<span class="text-decoration-line-through">
@Model.ListPrice.ToString("c")
@Model.Product.ListPrice.ToString("c")
</span>
</h6>
</div>
Expand All @@ -58,17 +58,17 @@
<div>Price</div>
</div>
<div class="p-1 col-3 col-lg-2 bg-white text-warning fw-bold">
<div>@Model.Price.ToString("c")</div>
<div>@Model.Product.Price.ToString("c")</div>
</div>
<div class="p-1 col-3 col-lg-2 bg-white text-warning fw-bold">
<div>@Model.Price50.ToString("c")</div>
<div>@Model.Product.Price50.ToString("c")</div>
</div>
<div class="p-1 col-3 col-lg-2 bg-white text-warning fw-bold">
<div>@Model.Price100.ToString("c")</div>
<div>@Model.Product.Price100.ToString("c")</div>
</div>
</div>
<div class="row pl-2 my-3">
<p class="text-secondary lh-sm">@Html.Raw(Model.Description)</p>
<p class="text-secondary lh-sm">@Html.Raw(Model.Product.Description)</p>
</div>
<div class="row pl-2 mb-3">
<div class="col-md-4">
Expand All @@ -77,17 +77,16 @@
id="inputGroup-sizing-default">
Count
</span>
<input type="number" value="1" class="form-control text-end"
<input type="number" asp-for="Count" value="1" class="form-control text-end"
aria-label="Sizing example input" aria-describedby="inputGroup-sizing-default" />

</div>
</div>
</div>
<div class="row">
<div class="col-12 col-md-6 pb-1">
<button type="submit" disabled
<button type="submit"
class="btn btn-primary bg-gradient w-100 py-2 text-uppercase fw-semibold">
Add to Cart (Comming Soon...)
Add to Cart
</button>
</div>
</div>
Expand Down

0 comments on commit 2a5bad3

Please sign in to comment.