-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Expand file tree
/
Copy pathIndex.cshtml
More file actions
90 lines (81 loc) · 1.84 KB
/
Index.cshtml
File metadata and controls
90 lines (81 loc) · 1.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
@model List<SimplCommerce.Module.Catalog.Models.Product>
@using System.Text.RegularExpressions
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>All Products</title>
<style>
body {
font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
background-color: #f5f5f5;
margin: 0;
padding: 0;
}
h1 {
text-align: center;
margin-top: 30px;
color: #333;
}
.product-container {
display: flex;
flex-wrap: wrap;
justify-content: center;
gap: 20px;
padding: 40px 20px;
}
.product-card {
background-color: #fff;
border: 1px solid #e0e0e0;
border-radius: 12px;
box-shadow: 0 4px 10px rgba(0,0,0,0.1);
width: 250px;
text-align: center;
padding: 20px;
transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover {
transform: translateY(-5px);
box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}
.product-card img {
width: 100%;
height: 180px;
object-fit: cover;
border-radius: 8px;
margin-bottom: 10px;
}
.product-card h3 {
font-size: 1.2rem;
margin-bottom: 10px;
color: #333;
}
.product-card p {
font-size: 0.9rem;
color: #555;
height: 50px;
overflow: hidden;
}
.product-card strong {
display: block;
margin-top: 10px;
color: #d32f2f;
font-size: 1rem;
}
</style>
</head>
<body>
<h1>All Products</h1>
<div class="product-container">
@foreach (var product in Model)
{
<div style="border: 1px solid #ddd; padding: 16px; margin-bottom: 12px;">
<img src="/user-content/@product.ThumbnailImage?.FileName" alt="@product.Name" style="max-width: 150px;" />
<h3>@product.Name</h3>
<p>@Html.Raw(Regex.Replace(product.Description, "<.*?>", string.Empty))</p>
<strong>Price: ₹@product.Price.ToString("F2")</strong>
</div>
}
</div>
</body>
</html>