|
|
@ -9,17 +9,16 @@ |
|
|
@inject IOptions<AbpRemoteServiceOptions> options |
|
|
@inject IOptions<AbpRemoteServiceOptions> options |
|
|
|
|
|
|
|
|
@{ |
|
|
@{ |
|
|
const int productsColumnSize = 4; // TODO: update abp-column helper to plain html for proper row and columns css |
|
|
|
|
|
string pageHeader = L["OurProducts"]; |
|
|
string pageHeader = L["OurProducts"]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@section styles{ |
|
|
@section styles{ |
|
|
<abp-style src="/Pages/index.css" /> |
|
|
<abp-style src="/Pages/index.css"/> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@section scripts { |
|
|
@section scripts { |
|
|
<abp-script src="/client-proxies/basket-proxy.js" /> |
|
|
<abp-script src="/client-proxies/basket-proxy.js"/> |
|
|
<abp-script src="/Pages/index.js" /> |
|
|
<abp-script src="/Pages/index.js"/> |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
@if (Model.HasRemoteServiceError) |
|
|
@if (Model.HasRemoteServiceError) |
|
|
@ -27,50 +26,50 @@ |
|
|
pageHeader = L["CatalogServiceNotAvailable"]; |
|
|
pageHeader = L["CatalogServiceNotAvailable"]; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
<div class="row"> |
|
|
<div class="container"> |
|
|
<div class="col-lg-12"> |
|
|
<h3 class="pb-4 text-center">@pageHeader</h3> |
|
|
<h3 class="pb-4 text-center">@pageHeader</h3> |
|
|
<div class=""> |
|
|
<div class="product-list"> |
|
|
<div class="product-list"> |
|
|
@for (int i = 0; i < Math.Ceiling(Model.Products.Count / (double)productsColumnSize); i++) |
|
|
@foreach (var product in Model.Products) |
|
|
{ |
|
|
{ |
|
|
<abp-row> |
|
|
var productPrice = product.Price.ToString("C", new CultureInfo("en-US")); |
|
|
@for (int j = 0; j < productsColumnSize; j++) |
|
|
string productImage = !product.ImageName.IsNullOrEmpty() ? $"{options.Value.RemoteServices.Default.BaseUrl}product-images/{product.ImageName}" : $"{options.Value.RemoteServices.Default.BaseUrl}product-images/@product.ImageName"; |
|
|
{ |
|
|
string buyText = L["Index:AddToBasket"]; |
|
|
<abp-column size-lg="_3" size-md="_4" size-sm="_6"> |
|
|
<div class="product-container"> |
|
|
@if ((i * productsColumnSize) + j < Model.Products.Count) |
|
|
<div class="product-list-item" data-product-id="@product.Id.ToString()"> |
|
|
|
|
|
<a href="/products/@product.Id.ToString()"> |
|
|
|
|
|
<div class="product-title"> |
|
|
|
|
|
<span> |
|
|
|
|
|
<h6>@product.Name</h6> |
|
|
|
|
|
<span class="d-block text-muted">@product.Code</span> |
|
|
|
|
|
</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="product-image"> |
|
|
|
|
|
<img src="@productImage" loading="lazy"/> |
|
|
|
|
|
</div> |
|
|
|
|
|
<div class="product-count"> |
|
|
|
|
|
<span class="d-block">@L["StockCount"]: @product.StockCount</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</a> |
|
|
|
|
|
<div class="product-item-bottom"> |
|
|
|
|
|
<div class="item-added"> |
|
|
|
|
|
<div class="fa fa-check" style="color: yellowgreen; padding-right: 1em;"></div> |
|
|
|
|
|
<span style="display: flex">Added to cart</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
@if (product.StockCount > 0) |
|
|
{ |
|
|
{ |
|
|
var product = Model.Products[(i * productsColumnSize) + j]; |
|
|
<abp-button class="add-basket-button" button-type="Warning" text="@buyText" data-product-id="@product.Id.ToString()"></abp-button> |
|
|
var productPrice = product.Price.ToString("C", new CultureInfo("en-US")); |
|
|
|
|
|
string productImage = !product.ImageName.IsNullOrEmpty() ? $"{options.Value.RemoteServices.Default.BaseUrl}product-images/{product.ImageName}" : $"{options.Value.RemoteServices.Default.BaseUrl}product-images/@product.ImageName"; |
|
|
|
|
|
string buyText = L["Index:AddToBasket"]; |
|
|
|
|
|
<div class="product-list-item" data-product-id="@product.Id.ToString()"> |
|
|
|
|
|
<a href="/products/@product.Id.ToString()"> |
|
|
|
|
|
<div class="col"> |
|
|
|
|
|
<div class="product-info-box"> |
|
|
|
|
|
<h6>@product.Name</h6> |
|
|
|
|
|
<em class="d-block text-muted">@product.Code - @L["StockCount"]: @product.StockCount</em> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
<img src="@productImage" /> |
|
|
|
|
|
</a> |
|
|
|
|
|
<div class="row mt-5 "> |
|
|
|
|
|
@if (product.StockCount > 0) |
|
|
|
|
|
{ |
|
|
|
|
|
<abp-button class="add-basket-button" button-type="Warning" text="@buyText" data-product-id="@product.Id.ToString()"></abp-button> |
|
|
|
|
|
} |
|
|
|
|
|
else |
|
|
|
|
|
{ |
|
|
|
|
|
<abp-button disabled="true" class="add-basket-button" button-type="Warning" text="@L["Index:OutOfStock"]" /> |
|
|
|
|
|
} |
|
|
|
|
|
<div class="info-section col" style="text-align: center"> |
|
|
|
|
|
<span class="product-price">@productPrice</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
} |
|
|
} |
|
|
</abp-column> |
|
|
else |
|
|
} |
|
|
{ |
|
|
</abp-row> |
|
|
<abp-button disabled="true" class="add-basket-button" button-type="Warning" text="@L["Index:OutOfStock"]"/> |
|
|
|
|
|
} |
|
|
|
|
|
<div class="info-section col"> |
|
|
|
|
|
<span class="product-price">@productPrice</span> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
|
|
|
</div> |
|
|
} |
|
|
} |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
</div> |
|
|
|