Merge branch 'main' of https://git.aycode.com/Adam/Mango.Nop.Plugins
This commit is contained in:
commit
40a0a63903
|
|
@ -187,7 +187,7 @@ public class AuctionPluginAdminController : BasePluginController
|
|||
|
||||
public async Task<IActionResult> GetAuctionById(int id)
|
||||
{
|
||||
var auction = await _auctionService.GetAuctionByIdAsync(id);
|
||||
var auction = await _auctionService.GetAuctionDtoByIdAsync(id, true, false);
|
||||
if (auction == null)
|
||||
return NotFound();
|
||||
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ window.refreshPublicBidBox = function (bidNotification, updateBidButtonDisabledS
|
|||
console.log(currency);
|
||||
|
||||
var bidButtonElement = document.getElementById("signalRBidButton" + ptaId);
|
||||
var bidButtonElementText = document.getElementById("signalRBidButtonText" + ptaId);
|
||||
var storedBidPricePlaceholder = document.getElementById("bidPriceContainer" + ptaId);
|
||||
var licitStepElement = document.getElementById("licitStepText" + ptaId);
|
||||
var bidBox = document.getElementById("publicProductBidBox" + ptaId);
|
||||
|
|
@ -154,10 +155,10 @@ window.refreshPublicBidBox = function (bidNotification, updateBidButtonDisabledS
|
|||
if (isMyBid) {
|
||||
console.log("This is my bid");
|
||||
list = bidBox.classList;
|
||||
list.add("bg-success");
|
||||
list.remove("bg-primary");
|
||||
//list.add("bg-success");
|
||||
//list.remove("bg-primary");
|
||||
|
||||
bidButtonElement.textContent = window.LocalizationStrings.GoodJob;
|
||||
bidButtonElementText.textContent = window.LocalizationStrings.GoodJob;
|
||||
bidBoxTitle.textContent = thisPta.auctionStatus == AuctionStatus.Sold ? window.LocalizationStrings.YouWin : window.LocalizationStrings.YourBidLeading;
|
||||
|
||||
if (window.IsAdmin) {
|
||||
|
|
@ -169,15 +170,15 @@ window.refreshPublicBidBox = function (bidNotification, updateBidButtonDisabledS
|
|||
}
|
||||
} else {
|
||||
list = bidBox.classList;
|
||||
list.add("bg-primary");
|
||||
list.remove("bg-success");
|
||||
//list.add("bg-primary");
|
||||
//list.remove("bg-success");
|
||||
bidBoxTitle.textContent = thisPta.auctionStatus == AuctionStatus.Sold ? window.LocalizationStrings.Sold : window.LocalizationStrings.PlaceABid;
|
||||
|
||||
if (currency.CurrencyCode == "EUR") {
|
||||
bidButtonElement.textContent = window.LocalizationStrings.BidButtonPrefix + EURFormatter.format(bidNotification.nextBidPrice * window.WorkingCurrency.Rate);
|
||||
bidButtonElementText.textContent = EURFormatter.format(bidNotification.nextBidPrice * window.WorkingCurrency.Rate);
|
||||
//bidButtonElement.textContent = EURFormatter.format(storedBidPricePlaceholder.value);
|
||||
} else {
|
||||
bidButtonElement.textContent = window.LocalizationStrings.BidButtonPrefix + HUFFormatter.format(bidNotification.nextBidPrice);
|
||||
bidButtonElementText.textContent = HUFFormatter.format(bidNotification.nextBidPrice);
|
||||
//bidButtonElement.textContent = HUFFormatter.format(storedBidPricePlaceholder.value);
|
||||
}
|
||||
bidButtonElement.disabled = false;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
window.HUFFormatter = new Intl.NumberFormat("hu-HU", {
|
||||
style: "currency",
|
||||
currency: "HUF",
|
||||
minimumFractionDigits: 0,
|
||||
maximumFractionDigits: 0,
|
||||
});
|
||||
window.EURFormatter = new Intl.NumberFormat("eu-EU", {
|
||||
style: "currency",
|
||||
|
|
|
|||
|
|
@ -9,6 +9,8 @@ public class AuctionDto : IAuctionDto
|
|||
{
|
||||
public int Id { get; set; }
|
||||
|
||||
public int? CategoryId { get; set; }
|
||||
|
||||
[NopResourceDisplayName("Name")]
|
||||
public string AuctionName { get; set; }
|
||||
|
||||
|
|
@ -28,6 +30,7 @@ public class AuctionDto : IAuctionDto
|
|||
if (auction == null) return;
|
||||
|
||||
Id = auction.Id;
|
||||
CategoryId = auction.CategoryId;
|
||||
AuctionName = auction.AuctionName;
|
||||
AuctionType = auction.AuctionType;
|
||||
StartDateUtc = auction.StartDateUtc;
|
||||
|
|
@ -42,7 +45,7 @@ public class AuctionDto : IAuctionDto
|
|||
mainEntity.Id = Id;
|
||||
mainEntity.AuctionName = AuctionName;
|
||||
mainEntity.AuctionType = AuctionType;
|
||||
mainEntity.CategoryId = 0;
|
||||
mainEntity.CategoryId = CategoryId;
|
||||
mainEntity.StartDateUtc = StartDateUtc;
|
||||
mainEntity.EndDateUtc = EndDateUtc;
|
||||
mainEntity.Closed = Closed;
|
||||
|
|
|
|||
|
|
@ -10,6 +10,22 @@
|
|||
.old-product-price {
|
||||
text-decoration: unset !important;
|
||||
}
|
||||
|
||||
.old-price {
|
||||
text-decoration: unset !important;
|
||||
}
|
||||
|
||||
.bg-bidbox {
|
||||
background-color: rgba(0,0,0,0.2);
|
||||
}
|
||||
|
||||
.bg-bidbox-success {
|
||||
background-color: rgba(170, 160, 129, 0.35);
|
||||
}
|
||||
|
||||
.btn-autoheight {
|
||||
height: auto !important;
|
||||
}
|
||||
</style>
|
||||
|
||||
@{
|
||||
|
|
@ -18,7 +34,7 @@
|
|||
if (Model.FirstProductToAuction != null)
|
||||
{
|
||||
|
||||
var bgClass = Model.FirstProductToAuction.WinnerCustomerId == Model.CustomerId ? "bg-success" : "bg-primary";
|
||||
var bgClass = Model.FirstProductToAuction.WinnerCustomerId == Model.CustomerId ? "bg-bidbox-success" : "bg-bidbox";
|
||||
var bidButtonActive = Model.IsItemActive && (Model.FirstProductToAuction.WinnerCustomerId != Model.CustomerId || Model.IsAdmin);
|
||||
var auctionStatus = Model.FirstProductToAuction.AuctionStatus;
|
||||
var lastBidIsMine = Model.FirstProductToAuction.WinnerCustomerId == Model.CustomerId;
|
||||
|
|
@ -73,15 +89,16 @@
|
|||
}
|
||||
|
||||
|
||||
<div id="publicProductBidBox@(Model.ProductToAuctionId)" class="p-3 @bgClass text-white">
|
||||
<div id="publicProductBidBox@(Model.ProductToAuctionId)" class="p-2 @bgClass">
|
||||
@*<div id="publicProductBidBox@(Model.ProductToAuctionId)" class="p-3 text-white">*@
|
||||
<input id="bidPriceContainer@(Model.ProductToAuctionId)" value="@Model.NextBidPrice" hidden />
|
||||
<div class="row">
|
||||
<div class="col-3"><strong>#@Model.AuctionDto.ProductToAuctionDtos.FirstOrDefault()!.SortIndex</strong></div>
|
||||
<div class="col-9"><a target="_blank" class="btn btn-secondary btn-sm float-end" href="https://youtube.com/live/6yfnmyQE7Uw?feature=share"><i class="fa-brands fa-youtube"></i> Youtube live</a></div>
|
||||
<div class="col-12"><strong>Item number: @Model.AuctionDto.ProductToAuctionDtos.FirstOrDefault()!.SortIndex</strong></div>
|
||||
@*<div class="col-9"><a target="_blank" class="btn btn-secondary btn-sm float-end" href="https://youtube.com/live/6yfnmyQE7Uw?feature=share"><i class="fa-brands fa-youtube"></i> Youtube live</a></div>*@
|
||||
</div>
|
||||
|
||||
<h4 id="bidBoxTitle@(Model.ProductToAuctionId)">@title</h4>
|
||||
<div class="row justify-content-between">
|
||||
<p id="bidBoxTitle@(Model.ProductToAuctionId)">@title</p>
|
||||
<div class="row justify-content-between m-0">
|
||||
@*<div class="col-xs-12 col-md-6 col-lg-4">
|
||||
<strong>Base Price:</strong>
|
||||
@{
|
||||
|
|
@ -98,41 +115,46 @@
|
|||
}
|
||||
|
||||
</div>*@
|
||||
<div class="col-xs-12 col-md-6 col-lg-4">
|
||||
<strong>Bid Step:</strong>
|
||||
<div class="col-xs-12 col-md-6">
|
||||
<div class="text-center">
|
||||
<i class="fa-solid fa-stairs align-middle"></i>
|
||||
@{
|
||||
if (Model.WorkingCurrency.CurrencyCode == "EUR")
|
||||
{
|
||||
<span id="licitStepText@(Model.ProductToAuctionId)" class="value">@($"{Model.LicitStepInWorkingCurrency.ToString("C", new CultureInfo("de-DE"))}")</span>
|
||||
<span id="licitStepText@(Model.ProductToAuctionId)" class="value align-middle">@($"{Model.LicitStepInWorkingCurrency.ToString("C", new CultureInfo("de-DE"))}")</span>
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// <span id="licitStepText" class="value">@($"{Model.LicitStep:c}")</span>
|
||||
<span id="licitStepText@(Model.ProductToAuctionId)" class="value">@($"{Model.LicitStep.ToString("C", new CultureInfo("hu-HU"))}")</span>
|
||||
<span id="licitStepText@(Model.ProductToAuctionId)" class="value align-middle">@($"{Model.LicitStep.ToString("C0", new CultureInfo("hu-HU"))}")</span>
|
||||
}
|
||||
}
|
||||
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 col-lg-4">
|
||||
<button id="signalRBidButton@(Model.ProductToAuctionId)" class="btn btn-success float-end" style="text-transform: uppercase;" type="button" @(!bidButtonActive ? "disabled" : string.Empty)>
|
||||
</div>
|
||||
<div class="col-xs-12 col-md-6 text-center">
|
||||
<button id="signalRBidButton@(Model.ProductToAuctionId)" class="btn btn-success btn-autoheight" style="text-transform: uppercase;" type="button" @(!bidButtonActive ? "disabled" : string.Empty)>
|
||||
<i class="fa-solid fa-hand"></i>
|
||||
<span id="signalRBidButtonText@(Model.ProductToAuctionId)">
|
||||
@{
|
||||
if (Model.WorkingCurrency.CurrencyCode == "EUR")
|
||||
{
|
||||
@T("Plugins.Misc.AuctionPlugin.BidButtonPrefix") @($"{Model.NextBidPriceInWorkingCurrency.ToString("C", new CultureInfo("de-DE"))}")
|
||||
@($"{Model.NextBidPriceInWorkingCurrency.ToString("C", new CultureInfo("de-DE"))}")
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// <span id="licitStepText" class="value">@($"{Model.LicitStep:c}")</span>
|
||||
|
||||
@T("Plugins.Misc.AuctionPlugin.BidButtonPrefix") @($"{Model.NextBidPrice.ToString("C", new CultureInfo("hu-HU"))}")
|
||||
@($"{Model.NextBidPrice.ToString("C0", new CultureInfo("hu-HU"))}")
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
</span>
|
||||
|
||||
</button>
|
||||
@* <button id="bidButton" class="btn btn-success">
|
||||
|
|
@ -153,20 +175,21 @@
|
|||
|
||||
if (Model.IsAdmin)
|
||||
{
|
||||
<div id="publicProductBidBoxAdmin@(Model.ProductToAuctionId)" class="p-3 bg-secondary text-white">
|
||||
<h4>Manage auction!</h4>
|
||||
<hr/>
|
||||
<div id="publicProductBidBoxAdmin@(Model.ProductToAuctionId)" class="p-2 bg-secondary text-white">
|
||||
@*<h4>Manage auction!</h4>*@
|
||||
<div id="bidBoxAdminButtons@(Model.ProductToAuctionId)" class="d-flex justify-content-between mb-3">
|
||||
|
||||
|
||||
<div>
|
||||
<button id="signalROpenItemButton@(Model.ProductToAuctionId)" class="btn btn-primary" style="text-transform: uppercase;" type="button" @(Model.AuctionStatus == AuctionStatus.None || Model.AuctionStatus == AuctionStatus.Pause ? string.Empty : "disabled hidden")>
|
||||
Open item
|
||||
<i class="fa-solid fa-lock-open"></i>
|
||||
</button>
|
||||
<button id="signalRPauseItemButton@(Model.ProductToAuctionId)" class="btn btn-warning" style="text-transform: uppercase;" type="button" @(Model.AuctionStatus == AuctionStatus.Active || Model.AuctionStatus == AuctionStatus.FirstWarning || Model.AuctionStatus == AuctionStatus.SecondWarning ? string.Empty : "disabled hidden")>
|
||||
Pause auction
|
||||
<i class="fa-solid fa-circle-pause"></i>
|
||||
</button>
|
||||
<button id="signalRRevertBidButton@(Model.ProductToAuctionId)" class="btn btn-warning" style="text-transform: uppercase;" type="button" @(Model.AuctionStatus != AuctionStatus.Pause ? "disabled hidden" : string.Empty)>
|
||||
Revert bid
|
||||
<i class="fa-solid fa-clock-rotate-left"></i>
|
||||
</button>
|
||||
<button id="signalRResetItemButton@(Model.ProductToAuctionId)" class="btn btn-danger" style="text-transform: uppercase;" type="button" @(Model.AuctionStatus != AuctionStatus.Pause ? "disabled hidden" : string.Empty)>
|
||||
Reset auction
|
||||
|
|
@ -309,7 +332,7 @@
|
|||
this.disabled = true;
|
||||
event.preventDefault();
|
||||
|
||||
sendAuctionStatusChange(AuctionStatus.None);
|
||||
sendAuctionStatusChange(ptaId, AuctionStatus.None);
|
||||
|
||||
return false;
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in New Issue