diff --git a/PizzaBot/Components/ArchiveListComponent.razor b/PizzaBot/Components/ArchiveListComponent.razor index bf61b5b..579a8b4 100644 --- a/PizzaBot/Components/ArchiveListComponent.razor +++ b/PizzaBot/Components/ArchiveListComponent.razor @@ -18,7 +18,7 @@ @if (ShowDate) { - + } @if (ShowPizzaTotal) { diff --git a/PizzaBot/Components/GlobalMessages.razor b/PizzaBot/Components/GlobalMessages.razor index eea9d0c..0e79a2e 100644 --- a/PizzaBot/Components/GlobalMessages.razor +++ b/PizzaBot/Components/GlobalMessages.razor @@ -7,10 +7,19 @@ } @if (GlobalStuffService.Message.Length >= 2) { -

@GlobalStuffService.Message

- +
@((MarkupString)Markdig.Markdown.ToHtml(GlobalStuffService.Message))
} + + @code{ protected override void OnInitialized() { diff --git a/PizzaBot/Components/Pages/Admin.razor b/PizzaBot/Components/Pages/Admin.razor index 88368f3..702e1ac 100644 --- a/PizzaBot/Components/Pages/Admin.razor +++ b/PizzaBot/Components/Pages/Admin.razor @@ -12,20 +12,28 @@

Order Locking

- +} +else +{ + + +} + +@if (ShowUnlockConfirmation) +{ +

Order(s) have already been marked as payed. If you unlock payment information WILL be lost!

+ +}

Global Message

- + @@ -136,15 +144,33 @@ bool WrongDeletionPasscode = false; string DeletionPasscode = ""; + bool ShowUnlockConfirmation = false; + void SaveNewPizzaConfig(EditContext editContext) { GlobalStuffService.SetConfig(PConfig); GlobalStuffService.ShouldBalance = true; } - void ToggleOrdersLocked() + void LockOrders() { - GlobalStuffService.SetOrdersLocked(!GlobalStuffService.OrdersLocked); + GlobalStuffService.SetOrdersLocked(true); + } + + void UnlockOrders() + { + if(PizzaDBService.GetAllResults().Where(o => o.hasPaid).Count() > 0) + { + ShowUnlockConfirmation = true; + return; + } + GlobalStuffService.SetOrdersLocked(false); + } + + void ConfirmedUnlockOrders() + { + ShowUnlockConfirmation = false; + GlobalStuffService.SetOrdersLocked(false); } void SetGlobalMessage() @@ -164,4 +190,4 @@ { PConfig = GlobalStuffService.GetConfig() ?? new PizzaConfig(); } -} \ No newline at end of file + } diff --git a/PizzaBot/Components/Pages/PizzaOrder.razor b/PizzaBot/Components/Pages/PizzaOrder.razor index 60692af..7f1c5cd 100644 --- a/PizzaBot/Components/Pages/PizzaOrder.razor +++ b/PizzaBot/Components/Pages/PizzaOrder.razor @@ -27,7 +27,8 @@ - One slice = ca. @GlobalStuffService.GetSizeOfSliceInCM2().ToString("F0") cm2 + One slice = ca. @GlobalStuffService.GetSizeOfSliceInCM2().ToString("F0") cm2 +
@@ -49,15 +50,16 @@

The balancing algorithm tries to avoid changes of the corresponding Variable
- E.g. If you want to only get pieces from your chosen category put the slider all the way to the left

- + E.g. If you want to only get pieces from your chosen category put the slider all the way to the left +

+
Category
Total Count
- + diff --git a/PizzaBot/PizzaBot.csproj b/PizzaBot/PizzaBot.csproj index 56f8723..9e7bfbe 100644 --- a/PizzaBot/PizzaBot.csproj +++ b/PizzaBot/PizzaBot.csproj @@ -15,6 +15,7 @@ +