Basic localizations added, livescreen fix

This commit is contained in:
Adam 2024-11-30 11:18:01 +01:00
parent b790d6e4ff
commit cc07f53cfe
5 changed files with 31 additions and 21 deletions

View File

@ -1,6 +1,6 @@
@model ProductAssignToAuctionViewModel
<div class="auction-settings-box">
<h3>@T("Plugins.Misc.AuctionPlugin.AssignToAuction")</h3>
<h3>@T("Plugins.Misc.AuctionPlugin.Admin.AssignToAuction")</h3>
<div id="assignAuctionContainer">
<h3>Assign Product to Auction</h3>
@ -8,7 +8,7 @@
<input type="hidden" id="startingPrice" value="@Model.StartingPrice" />
<input type="hidden" id="bidPrice" value="@Model.StartingPrice" />
<label for="auctionDropdown">@T("Plugins.Misc.AuctionPlugin.SelectAuction")</label>
<label for="auctionDropdown">@T("Plugins.Misc.AuctionPlugin.Admin.SelectAuction")</label>
<select id="auctionDropdown" class="form-control">
<option value="">Select an auction...</option>
@foreach (var auction in ViewBag.Auctions as List<Nop.Plugin.Misc.AuctionPlugin.Domains.Entities.Auction>)
@ -17,7 +17,7 @@
}
</select>
<button id="assignAuctionButton" class="btn btn-primary mt-2">@T("Plugins.Misc.AuctionPlugin.AssignToAuctionButton")</button>
<button id="assignAuctionButton" class="btn btn-primary mt-2">@T("Plugins.Misc.AuctionPlugin.Admin.AssignToAuctionButton")</button>
</div>

View File

@ -31,9 +31,9 @@
var audio = new Audio('../Plugins/Misc.AuctionPlugin/Content/ding.mp3');
audio.play();
//console.log(data);
console.log(data);
var myObject = JSON.parse(data);
//console.log(myObject);
console.log(myObject);
var auctionDto = myObject.auctionDto;
var productToAuctionDto = auctionDto.productToAuctionDtos[0];

View File

@ -48,7 +48,16 @@
<div class="row">
<div class="col-md-8 col-12">
<h1 class="card-title">@Model.ActiveProductDetails.Name</h1>
<h2 class="text-muted mb-3">Created by: <span class="font-weight-bold">@Model.ActiveProductDetails.ProductManufacturers.FirstOrDefault().Name</span></h2>
@if(Model.ActiveProductDetails.ProductManufacturers != null)
{
if(Model.ActiveProductDetails.ProductManufacturers.FirstOrDefault() != null)
{
if(!string.IsNullOrEmpty(Model.ActiveProductDetails.ProductManufacturers.FirstOrDefault().Name))
{
<h2 class="text-muted mb-3">Created by: <span class="font-weight-bold">@Model.ActiveProductDetails.ProductManufacturers.FirstOrDefault().Name</span></h2>
}
}
}
</div>
<div class="col-md-4 col-12">
<h3 class="text-end"> Item no.: @Model.CurrentProductToAuction.SortIndex </h3>

View File

@ -60,18 +60,18 @@
console.log("isActive: " + isActive);
productItem.prepend('<div id="' +
publicInfoOverlayId +
'" class="bg-success p-1 text-white text-center" style="position: absolute; width: calc(100% - 1rem); height: 50px; z-index: 1;"><p class="m-0"><i class="fa-solid fa-gavel"> ' +
'LIVE RIGTH NOW' +
'</i></p><span>' +
'" class="bg-success p-1 text-white text-center" style="position: absolute; width: calc(100% - 1rem); height: 50px; z-index: 1;"><p class="m-0"><i class="fa-solid fa-gavel"></i> ' +
'@T("Plugins.Misc.AuctionPlugin.LiveNow")' +
'</p><span>' +
"No.: " + productToAuctionDto.sortIndex +
'</span></div>');
} else {
console.log("isActive: " + isActive);
productItem.prepend('<div id="' +
publicInfoOverlayId +
'" class="bg-primary p-1 text-white text-center" style="position: absolute; width: calc(100% - 1rem); height: 50px; z-index: 1;"><p class="m-0"><i class="fa-solid fa-gavel"> ' +
'" class="bg-primary p-1 text-white text-center" style="position: absolute; width: calc(100% - 1rem); height: 50px; z-index: 1;"><p class="m-0"><i class="fa-solid fa-gavel"></i> ' +
resultDate.toLocaleString() +
'</i></p><span>' +
'</p><span>' +
"No.: " + productToAuctionDto.sortIndex +
'</span></div>');
}

View File

@ -18,9 +18,9 @@
var title = auctionStatus switch
{
AuctionStatus.Sold => lastBidIsMine ? "You're the winner!" : "Sold",
AuctionStatus.NotSold => "Finished",
_ => lastBidIsMine ? "Your bid is leading" : "Place a bid!"
AuctionStatus.Sold => lastBidIsMine ? @T("Plugins.Misc.AuctionPlugin.YouWin") : @T("Plugins.Misc.AuctionPlugin.Sold"),
AuctionStatus.NotSold => @T("Plugins.Misc.AuctionPlugin.Finished"),
_ => lastBidIsMine ? @T("Plugins.Misc.AuctionPlugin.YourBidLeading") : @T("Plugins.Misc.AuctionPlugin.PlaceABid")
};
<div class="d-flex justify-content-between" id="otherAuctionItems">
@ -32,7 +32,7 @@
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">@(string.IsNullOrEmpty(Model.LastProductUrl) ? "Start of list" : "Back to last")</h5>
<h5 class="card-title">@(string.IsNullOrEmpty(Model.LastProductUrl) ? @T("Plugins.Misc.AuctionPlugin.StartOfList") : @T("Plugins.Misc.AuctionPlugin.BackToLast"))</h5>
<p class="card-text">@(string.IsNullOrEmpty(Model.LastProductName) ? "---" : Model.LastProductName)</p>
</div>
</div>
@ -48,7 +48,7 @@
</div>
<div class="col-md-8">
<div class="card-body">
<h5 class="card-title">@(string.IsNullOrEmpty(Model.NextProductUrl) ? "End of list" : "Coming up next...")</h5>
<h5 class="card-title">@(string.IsNullOrEmpty(Model.NextProductUrl) ? @T("Plugins.Misc.AuctionPlugin.EndOfList") : @T("Plugins.Misc.AuctionPlugin.ComingUp"))</h5>
<p class="card-text">@(string.IsNullOrEmpty(Model.NextProductName) ? "---" : Model.NextProductName)</p>
</div>
</div>
@ -58,6 +58,7 @@
</div>
<div id="publicProductBidBox" class="p-3 @bgClass text-white">
<h3>Item no.: @Model.AuctionDto.ProductToAuctionDtos.FirstOrDefault().SortIndex</h3>
<h4 id="bidBoxTitle">@title</h4>
<div class="d-flex justify-content-between">
<div>
@ -73,7 +74,7 @@
</div>
<div>
<button id="signalRBidButton" class="btn btn-success" style="text-transform: uppercase;" type="button" @(!bidButtonActive ? "disabled" : string.Empty)>
Bid @($"{Model.NextBidPrice:c}")
@T("Plugins.Misc.AuctionPlugin.BidButtonPrefix") @($"{Model.NextBidPrice:c}")
</button>
@* <button id="bidButton" class="btn btn-success">
@ -130,7 +131,7 @@
}
else
{
<p>No access to admin level buttons</p>
// <p>No access to admin level buttons</p>
}
}
}
@ -140,7 +141,7 @@
<h4>This item is under auction!</h4>
<div id="bidBoxGuestMessage" class="d-flex justify-content-between mb-3">
<p>Please log in or register to participate!</p>
<p>@T("Plugins.Misc.AuctionPlugin.PleaseLogInOrRegister")</p>
</div>
</div>
}
@ -343,7 +344,7 @@
list = bidBox.classList;
list.add("bg-success");
list.remove("bg-primary");
bidButtonElement.textContent = "Good job";
bidButtonElement.textContent = "@(T("Plugins.Misc.AuctionPlugin.GoodJob"))";
bidBoxTitle.textContent = productToAuction.auctionStatus == AuctionStatus.Sold ? "You're the winner!" : "Your bid is leading!";
if (bidBoxPageViewModel.IsAdmin) {
console.log("I AM WEASEL!!! " + bidBoxPageViewModel.IsAdmin);
@ -359,7 +360,7 @@
list.add("bg-primary");
list.remove("bg-success");
bidBoxTitle.textContent = productToAuction.auctionStatus == AuctionStatus.Sold ? "Sold" : "Place a bid!";
bidButtonElement.textContent = "Bid " + HUFFormatter.format(bidBoxPageViewModel.NextBidPrice);
bidButtonElement.textContent = "@(T("Plugins.Misc.AuctionPlugin.BidButtonPrefix")) " + HUFFormatter.format(bidBoxPageViewModel.NextBidPrice);
}