diff --git a/Nop.Plugin.Misc.AuctionPlugin/Areas/Admin/Controllers/AuctionPluginAdminController.cs b/Nop.Plugin.Misc.AuctionPlugin/Areas/Admin/Controllers/AuctionPluginAdminController.cs index faec1d5..f186b1c 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Areas/Admin/Controllers/AuctionPluginAdminController.cs +++ b/Nop.Plugin.Misc.AuctionPlugin/Areas/Admin/Controllers/AuctionPluginAdminController.cs @@ -187,7 +187,7 @@ public class AuctionPluginAdminController : BasePluginController public async Task GetAuctionById(int id) { - var auction = await _auctionService.GetAuctionByIdAsync(id); + var auction = await _auctionService.GetAuctionDtoByIdAsync(id, true, false); if (auction == null) return NotFound(); diff --git a/Nop.Plugin.Misc.AuctionPlugin/Content/Js/Auction.js b/Nop.Plugin.Misc.AuctionPlugin/Content/Js/Auction.js index ff0266b..c631284 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Content/Js/Auction.js +++ b/Nop.Plugin.Misc.AuctionPlugin/Content/Js/Auction.js @@ -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; diff --git a/Nop.Plugin.Misc.AuctionPlugin/Content/Js/LiveAnnouncement.js b/Nop.Plugin.Misc.AuctionPlugin/Content/Js/LiveAnnouncement.js index 68d5074..77c0aaa 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Content/Js/LiveAnnouncement.js +++ b/Nop.Plugin.Misc.AuctionPlugin/Content/Js/LiveAnnouncement.js @@ -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", diff --git a/Nop.Plugin.Misc.AuctionPlugin/Domains/Dtos/AuctionDto.cs b/Nop.Plugin.Misc.AuctionPlugin/Domains/Dtos/AuctionDto.cs index 4de1319..c16111d 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Domains/Dtos/AuctionDto.cs +++ b/Nop.Plugin.Misc.AuctionPlugin/Domains/Dtos/AuctionDto.cs @@ -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; diff --git a/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml b/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml index 0667247..20c25db 100644 --- a/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml +++ b/Nop.Plugin.Misc.AuctionPlugin/Views/PublicProductBidBox.cshtml @@ -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; + } @{ @@ -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; @@ -33,56 +49,57 @@ if (Model.WidgetZone.Equals(PublicWidgetZones.ProductDetailsOverviewTop)) { - -
- -
-
- @*
+ +
+ +
+ + - -
-
- @*
+ + } -
- -
-
#@Model.AuctionDto.ProductToAuctionDtos.FirstOrDefault()!.SortIndex
- -
+
+ @*
*@ + +
+
Item number: @Model.AuctionDto.ProductToAuctionDtos.FirstOrDefault()!.SortIndex
+ @**@ +
-

@title

-
- @*
+

@title

+
+ @*
Base Price: @{ if (Model.WorkingCurrency.CurrencyCode == "EUR") @@ -98,95 +115,101 @@ }
*@ -
- Bid Step: - @{ - if (Model.WorkingCurrency.CurrencyCode == "EUR") - { - @($"{Model.LicitStepInWorkingCurrency.ToString("C", new CultureInfo("de-DE"))}") - - } - else - { - // @($"{Model.LicitStep:c}") - @($"{Model.LicitStep.ToString("C", new CultureInfo("hu-HU"))}") - } - } - -
-
- - @* + @* *@ -
-
+
+
- @* *@ -
-
+
+
if (Model.IsAdmin) { -
-

Manage auction!

-
+
+
+ @*

Manage auction!

*@ +
-
- - - - -
-
- - - -
- - -
+
+ + + +
+
+ + + +
+ + +
+
} else { @@ -196,13 +219,13 @@ } else { -
-

This item is under auction!

-
+
+

This item is under auction!

+
-

@T("Plugins.Misc.AuctionPlugin.PleaseLogInOrRegister")

-
-
+

@T("Plugins.Misc.AuctionPlugin.PleaseLogInOrRegister")

+
+
} } @@ -224,7 +247,7 @@ setOnClicks(bidBoxPageViewModel.ProductToAuctionId, bidBoxPageViewModel); //var status = bidBoxPageViewModel.productToAuctionDto.auctionStatus; //setButtons(status); - }); + }); function setOnClicks(ptaId, viewModel) { @@ -235,7 +258,7 @@ sendBidMessage(ptaId, viewModel.AuctionId, storedBidPrice, - viewModel.ProductId + viewModel.ProductId ); }); @@ -309,7 +332,7 @@ this.disabled = true; event.preventDefault(); - sendAuctionStatusChange(AuctionStatus.None); + sendAuctionStatusChange(ptaId, AuctionStatus.None); return false; }); @@ -322,7 +345,7 @@ // sendMessageToServer("RevertAuctionBidRequest", bidBoxPageViewModel.ProductToAuctionId); // } - + function setBidButtonDisabled(bidButtonElement, disabled, updateDisabledState = true) { if (!updateDisabledState) return; @@ -341,6 +364,6 @@ domElement.disabled = disabled; } - - + + \ No newline at end of file