Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

8.7 KB
Raw Blame
@model CustomerAuctionsModel
@inject IPageHeadBuilder pagebuilder
@{
    Layout = "_TwoColumns";
    //title
    pagebuilder.AddTitleParts(Loc["Title.Auctions"]);
}

@section left
{
    @await Component.InvokeAsync("CustomerNavigation", new { selectedTabId = AccountNavigationEnum.Auctions })
}

<div class="page account-page auction-list-page ps-lg-3 pt-3 pt-lg-0">
    <h1 class="h2 generalTitle">@Loc["Account.CustomerAuctions"]</h1>
    @if (Model.ProductBidList.Any())
    {
        <div>
            <gn-tabs content-class="mt-3">
                <gn-tab title="@Loc["Account.Auctions.Tab.Ongoing"]" active="true">
                    @if (Model.ProductBidList.Any(x => !x.Ended))
                    {
                        <div id="auction-table-ongoing" class="table-responsive">
                            <table class="table">
                                <thead role="rowgroup">
                                <tr role="row">
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.ProductName"]</div>
                                    </th>
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.Status"]</div>
                                    </th>
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.Highestbid"]</div>
                                    </th>
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.AuctionEndTime"]</div>
                                    </th>
                                </tr>
                                </thead>
                                <tbody role="rowgroup">
                                @{
                                    var ongoing = Model.ProductBidList.Where(x => !x.Ended);
                                }
                                @foreach (var item in ongoing)
                                {
                                    <tr role="row">
                                        <td>
                                            <div>
                                                <a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })">@item.ProductName</a>
                                            </div>
                                        </td>
                                        @if (item.HighestBidder)
                                        {
                                            <td>
                                                <div>
                                                    <span class="text-success">@Loc["Account.CustomerAuctions.Status.HighestBidder"]</span>
                                                </div>
                                            </td>
                                        }
                                        else
                                        {
                                            <td>
                                                <div>
                                                    <span class="text-danger">@Loc["Account.CustomerAuctions.Status.Outbid"]</span>
                                                </div>
                                            </td>
                                        }
                                        <td>
                                            <div>
                                                @item.CurrentBidAmount
                                                @if (item.CurrentBidAmountValue > item.BidAmountValue)
                                                {
                                                    <small>(@item.BidAmount)</small>
                                                }
                                            </div>
                                        </td>
                                        <td>
                                            <div>@item.EndBidDate</div>
                                        </td>
                                    </tr>
                                }
                                </tbody>
                            </table>
                        </div>
                    }
                    else
                    {
                        <div class="no-data alert alert-info">
                            @Loc["Account.Auctions.NoOngoingAuctions"]
                        </div>
                    }
                </gn-tab>
                <gn-tab title="@Loc["Account.Auctions.Tab.Ended"]">
                    @if (Model.ProductBidList.Any(x => x.Ended))
                    {
                        <div id="auction-table-ended" class="table-responsive">
                            <table class="table">
                                <thead role="rowgroup">
                                <tr role="row">
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.ProductName"]</div>
                                    </th>
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.Status"]</div>
                                    </th>
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.Highestbid"]</div>
                                    </th>
                                    <th role="columnheader">
                                        <div>@Loc["Account.CustomerAuctions.AuctionEndTime"]</div>
                                    </th>
                                </tr>
                                </thead>
                                <tbody role="rowgroup">
                                @{
                                    var ended = Model.ProductBidList.Where(x => x.Ended);
                                }

                                @foreach (var item in ended)
                                {
                                    <tr role="row">
                                        <td>
                                            <div>
                                                <a href="@Url.RouteUrl("Product", new { SeName = item.ProductSeName })">@item.ProductName</a>
                                            </div>
                                        </td>
                                        @if (item.HighestBidder)
                                        {
                                            <td>
                                                <div>
                                                    <span class="text-success">@Loc["Account.CustomerAuctions.Status.HighestBidder"]</span>
                                                </div>
                                            </td>
                                        }
                                        else
                                        {
                                            <td>
                                                <div>
                                                    <span class="text-danger">@Loc["Account.CustomerAuctions.Status.Outbid"]</span>
                                                </div>
                                            </td>
                                        }
                                        <td>
                                            <div>
                                                @item.CurrentBidAmount
                                                @if (item.CurrentBidAmountValue > item.BidAmountValue)
                                                {
                                                    <small>(@item.BidAmount)</small>
                                                }
                                            </div>
                                        </td>
                                        <td>
                                            <div>@item.EndBidDate</div>
                                        </td>
                                    </tr>
                                }
                                </tbody>
                            </table>
                        </div>
                    }
                    else
                    {
                        <div class="no-data alert alert-info">
                            @Loc["Account.Auctions.NoOngoingAuctions"]
                        </div>
                    }
                </gn-tab>
            </gn-tabs>
        </div>
    }
    else
    {
        <div class="no-data alert alert-info">
            @Loc["Account.Auctions.NoAuctions"]
        </div>
    }
</div>