Skip to content

Commit

Permalink
customer - cards changed into table
Browse files Browse the repository at this point in the history
  • Loading branch information
DanielŻuławski committed Oct 18, 2021
1 parent d51d47f commit c54f69b
Show file tree
Hide file tree
Showing 2 changed files with 96 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,36 +16,51 @@
<h1 class="h2 generalTitle">@Loc["Account.CustomerMerchandiseReturns"]</h1>
@if (Model.Items.Any())
{
<div class="row">
@foreach (var item in Model.Items)
{
<div class="col col-lg-6 col-md-6 col-12">
<div class="card">
<div class="card-header">
<h5 class="mb-0">
@string.Format(Loc["Account.CustomerMerchandiseReturns.Title"], item.ReturnNumber, item.MerchandiseReturnStatus)
</h5>
</div>
<div class="card-body">
<div class="d-inline-flex align-items-center flex-wrap mb-3">
<b-icon icon="calendar2-check" variant="info" class="mx-2"></b-icon>
<small class="date text-muted">
<label class="mb-0">@Loc["Account.CustomerMerchandiseReturns.Date"]</label>
<span>@item.CreatedOn.ToString()</span>
</small>
</div>
<div class="alert alert-info mb-0">
@string.Format(Loc["Account.CustomerMerchandiseReturns.Totals"], item.ProductsCount, item.ReturnTotal)
</div>
</div>
<div class="card-footer">
<button class="btn btn-sm btn-info" onclick="location = ('@Url.RouteUrl("MerchandiseReturnDetails", new { merchandiseReturnId = item.Id })')">
@Loc["Account.CustomerMerchandiseReturns.Details"]
</button>
</div>
</div>
</div>
}
<div class="table-responsive">
<table class="table hover-table">
<thead>
<tr>
<th scope="col">@Loc["Account.CustomerMerchandiseReturns.Number"]</th>
<th scope="col">@Loc["Account.CustomerMerchandiseReturns.Status"]</th>
<th scope="col">@Loc["Account.CustomerMerchandiseReturns.Date"]</th>
<th scope="col">@Loc["Account.CustomerMerchandiseReturns.Count"]</th>
<th scope="col">@Loc["Account.CustomerMerchandiseReturns.Totals"]</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach (var item in Model.Items)
{
<tr>
<td>
<span>@item.ReturnNumber</span>
</td>
<td>
<span class="@item.MerchandiseReturnStatus.ToLower() badge status">@item.MerchandiseReturnStatus</span>
</td>
<td>
<div class="d-inline-flex align-items-center flex-nowrap">
<b-icon icon="calendar2-check" variant="info" class="mx-2"></b-icon>
<small class="date text-muted">
<span>@item.CreatedOn.ToString()</span>
</small>
</div>
</td>
<td>
<span>@item.ProductsCount</span>
</td>
<td>
<span>@item.ReturnTotal</span>
</td>
<td>
<button class="btn btn-sm btn-info" onclick="location = ('@Url.RouteUrl("MerchandiseReturnDetails", new { merchandiseReturnId = item.Id })')">
@Loc["Account.CustomerMerchandiseReturns.Details"]
</button>
</td>
</tr>
}
</tbody>
</table>
</div>
}
else
Expand Down
53 changes: 51 additions & 2 deletions src/Web/Grand.Web/Views/Order/CustomerOrders.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,56 @@
<h1 class="generalTitle h2">@Loc["Account.CustomerOrders"]</h1>
@if (Model.Orders.Any())
{
<div class="account-order">
<div class="account-order table-responsive">
<table class="table hover-table">
<thead>
<tr>
<th scope="col">@Loc["Account.CustomerOrders.OrderNumber"]</th>
<th scope="col">@Loc["Account.CustomerOrders.OrderStatus"]</th>
<th scope="col">@Loc["Account.CustomerOrders.OrderDate"]</th>
<th scope="col">@Loc["Account.CustomerOrders.OrderTotal"]</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach (var order in Model.Orders)
{
<tr>
<td>
<span>@order.OrderNumber</span>
</td>
<td>
<span class="@order.OrderStatus.ToLower() badge status order-status">@order.OrderStatus</span>
</td>
@if (supportRtl)
{
<td>
<span>@Convert.ToDateTime(order.CreatedOn).ToString("tt HH:mm yyyy/MM/dd")</span>
</td>
} else {
<td>
<span>@order.CreatedOn.ToString("g")</span>
</td>
}
<td>
<span class="order-total">@order.OrderTotal</span>
</td>
<td>
<div class="buttons d-flex flex-column">
<input type="button" value="@Loc["Account.CustomerOrders.OrderDetails"]" class="btn btn-sm btn-info order-details-button" onclick="location = ('@Url.RouteUrl("OrderDetails", new { orderId = order.Id })')" />
@if (order.IsMerchandiseReturnAllowed)
{
<input type="button" value="@Loc["Account.CustomerOrders.ReturnItems"]" class="btn btn-sm btn-warning text-white return-items-button mt-1" onclick="location = ('@Url.RouteUrl("MerchandiseReturn", new { orderId = order.Id })')" />
}
</div>
</td>
</tr>
}
</tbody>
</table>
</div>

@*<div class="account-order">
<div class="row">
@foreach (var order in Model.Orders)
{
Expand Down Expand Up @@ -62,7 +111,7 @@
</div>
}
</div>
</div>
</div>*@
<page-navigation asp-query-param="pagenumber" asp-pagination="Model.PagingContext" />
}
else
Expand Down

0 comments on commit c54f69b

Please sign in to comment.