SA-55 add wishlist page

This commit is contained in:
AndriiSyrotenko 2023-10-15 15:18:09 +00:00
parent ff8afd6c67
commit 93171a7c9b
73 changed files with 75442 additions and 75292 deletions

View File

@ -0,0 +1,10 @@
@page
@model ShoppingAssistantWebClient.Web.Pages.CartModel
@{
}
<h1 style="text-align: center; margin-bottom: 50px">Cart</h1>
<div>
</div>

View File

@ -0,0 +1,12 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ShoppingAssistantWebClient.Web.Pages
{
public class CartModel : PageModel
{
public void OnGet()
{
}
}
}

View File

@ -0,0 +1,75 @@
@page
@model ShoppingAssistantWebClient.Web.Pages.WishlistModel
@{
//Layout = null;
}
<style>
.table-container {
width: 95%;
height: 95%;
display: flex;
justify-content: center;
align-items: center;
margin: auto;
}
.styled-table {
border-collapse: collapse;
width: 100%;
max-width: 100%;
}
.styled-table th {
border-bottom: 1px solid #ddd;
text-align: center;
font-size: larger;
background-color: rgba(0, 159, 255, 0.1);
}
.styled-table td {
border-bottom: 5px solid #FFF;
border-top: 5px solid #FFF;
text-align: center;
font-size: large;
padding: 20px;
background-color: rgba(248, 248, 255, 1);
}
</style>
<h1 style="text-align: center; margin-bottom: 50px">My Wishlist</h1>
<div class="table-container">
@if(!(Model.wishlist is null))
{
<table class="styled-table">
<thead>
<tr>
<th> </th>
<th style="text-align: left;">Chat name</th>
<th>Type</th>
<th>Time</th>
<th></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.wishlist)
{
<tr>
<form method="post" asp-page-handler="Delete" asp-route-id="@item.Id">
<td><input type="image" src="~/assets/x-button.png"></td>
</form>
<td style="text-align: left">@Html.DisplayFor(modelItem => item.Name)</td>
<td>@Html.DisplayFor(modelItem => item.Type)</td>
<td>@Html.DisplayFor(modelItem => item.Date)</td>
<form method="post" asp-page="Wishlist">
<td><input type="image" src="~/assets/shopping-cart.png" asp-page-handler="MoveToChat"></td>
</form>
</tr>
}
</tbody>
</table>
}
else
{
<h3>You don't have a wishlist</h3>
}
</div>

View File

@ -0,0 +1,34 @@
using Microsoft.AspNetCore.Mvc;
using Microsoft.AspNetCore.Mvc.RazorPages;
namespace ShoppingAssistantWebClient.Web.Pages
{
public class WishlistModel : PageModel
{
public List<Wishlist> wishlist = new List<Wishlist>{
new Wishlist {Id = 0, Name = "Chat1", Type="product", Date="21.09.2023"},
new Wishlist {Id = 1, Name = "Chat2", Type="gift", Date="29.09.2023"},
new Wishlist {Id = 2, Name = "Chat3", Type="product", Date="02.10.2023"}
};
public void OnGet()
{
}
public void OnPostDelete(int id) {
var item = wishlist.FirstOrDefault(wishlist => wishlist.Id == id);
wishlist.RemoveAt(id);
}
public IActionResult OnPostMoveToChat() {
return RedirectToPage("Index");
}
}
public class Wishlist {
public int Id {get; set;}
public string Name {get; set;}
public string Type {get; set;}
public string Date {get; set;}
}
}

View File

@ -21,8 +21,8 @@ app.UseStaticFiles();
app.UseRouting(); app.UseRouting();
//app.UseAuthorization(); app.UseAuthorization();
app.ConfigureGlobalUserMiddleware(); //app.ConfigureGlobalUserMiddleware();
app.MapRazorPages(); app.MapRazorPages();

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 383 B

19
certificate.crt Normal file
View File

@ -0,0 +1,19 @@
-----BEGIN CERTIFICATE-----
MIIDDTCCAfWgAwIBAgIJAIY32av1vGiXMA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV
BAMTCWxvY2FsaG9zdDAeFw0yMzEwMTIyMTQzMzdaFw0yNDEwMTEyMTQzMzdaMBQx
EjAQBgNVBAMTCWxvY2FsaG9zdDCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoC
ggEBAMpQ4oas7Zbq17Ac4NErM3CdYHdaIv3VdonmljCdcs+7atEAxxNt8wPAJfsm
I5dlOXST5ZcfA2zggpYwlvjoiQl1AdjRTlVkB0bRhvdV9exJUyag90GLcau+APxO
VqBlLEEIHabkvSFG36RDWQsP1yx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