From 3dd0965caed612811205245a947351f03d4dff64 Mon Sep 17 00:00:00 2001 From: Kukks Date: Thu, 23 Mar 2023 09:47:07 +0100 Subject: [PATCH] fix ticket tailor --- .../BTCPayServer.Plugins.TicketTailor.csproj | 2 +- .../TicketTailorController.cs | 2 +- .../Views/TicketTailor/View.cshtml | 31 +++++++------------ 3 files changed, 13 insertions(+), 22 deletions(-) diff --git a/Plugins/BTCPayServer.Plugins.TicketTailor/BTCPayServer.Plugins.TicketTailor.csproj b/Plugins/BTCPayServer.Plugins.TicketTailor/BTCPayServer.Plugins.TicketTailor.csproj index 2799aac..9aef82c 100644 --- a/Plugins/BTCPayServer.Plugins.TicketTailor/BTCPayServer.Plugins.TicketTailor.csproj +++ b/Plugins/BTCPayServer.Plugins.TicketTailor/BTCPayServer.Plugins.TicketTailor.csproj @@ -9,7 +9,7 @@ TicketTailor Allows you to integrate with TicketTailor.com to sell tickets for Bitcoin - 1.0.10 + 1.0.11 diff --git a/Plugins/BTCPayServer.Plugins.TicketTailor/TicketTailorController.cs b/Plugins/BTCPayServer.Plugins.TicketTailor/TicketTailorController.cs index e016c8b..6c9b10a 100644 --- a/Plugins/BTCPayServer.Plugins.TicketTailor/TicketTailorController.cs +++ b/Plugins/BTCPayServer.Plugins.TicketTailor/TicketTailorController.cs @@ -70,7 +70,7 @@ namespace BTCPayServer.Plugins.TicketTailor { if (purchaseRequestItem.Quantity <= 0) { - continue;; + continue; } var ticketType = evt.TicketTypes.FirstOrDefault(type => type.Id == purchaseRequestItem.TicketTypeId); diff --git a/Plugins/BTCPayServer.Plugins.TicketTailor/Views/TicketTailor/View.cshtml b/Plugins/BTCPayServer.Plugins.TicketTailor/Views/TicketTailor/View.cshtml index f732794..5f6b030 100644 --- a/Plugins/BTCPayServer.Plugins.TicketTailor/Views/TicketTailor/View.cshtml +++ b/Plugins/BTCPayServer.Plugins.TicketTailor/Views/TicketTailor/View.cshtml @@ -51,7 +51,7 @@ document.addEventListener("DOMContentLoaded", ()=>{ })) document.querySelector("form").addEventListener("submit", ()=>{ btn.setAttribute("disabled", "disabled"); - inputs.forEach(value => value.setAttribute("disabled", "disabled")); + inputs.forEach(value => value.setAttribute("readonly", "readonly")); }) }) @@ -74,13 +74,13 @@ document.addEventListener("DOMContentLoaded", ()=>{
- +
- +
@@ -89,8 +89,7 @@ document.addEventListener("DOMContentLoaded", ()=>{ @{ var index = -1; - var firstPurchaseable = true; - + foreach (var groupedTickets in Model.Event.TicketTypes.GroupBy(type => type.GroupId).OrderBy(groupedTickets => Model.Event.TicketGroups.FirstOrDefault(ticketGroup => ticketGroup.Id == groupedTickets.Key)?.SortOrder)) {
@@ -104,11 +103,7 @@ document.addEventListener("DOMContentLoaded", ()=>{ } @foreach (var item in groupedTickets) { - var availableToShow = new[] {"on_sale", "sold_out", "unavailable"}.Contains(item.Status); - if (!string.IsNullOrEmpty(item.AccessCode) && item.AccessCode.Equals(accessCode, StringComparison.InvariantCultureIgnoreCase)) - { - availableToShow = true; - } + var availableToShow = new[] {"on_sale", "sold_out", "unavailable"}.Contains(item.Status) || !string.IsNullOrEmpty(item.AccessCode) && item.AccessCode.Equals(accessCode, StringComparison.InvariantCultureIgnoreCase); var specific = false; if (Model.Settings.SpecificTickets?.Any() is true) @@ -142,23 +137,21 @@ document.addEventListener("DOMContentLoaded", ()=>{ var purchasable = available && (specific || new[] {"on_sale", "locked"}.Contains(item.Status)) && item.Quantity > 0; -
-
+
+
@item.Name

@Safe.Raw(item.Description)

-
+
@if (purchasable) { - - // var value = firstPurchaseable && Model.Items?.Any(requestItem => requestItem.Quantity > 0) is not true? 1: Model.Items?.ElementAtOrDefault(index)?.Quantity??0;
+ min="0" data-price="@item.Price" /> - +
@@ -166,12 +159,10 @@ document.addEventListener("DOMContentLoaded", ()=>{
- - firstPurchaseable = false; } else { -
Unavailable
+
Unavailable
}