Compare commits
5 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a815a61460 | ||
|
|
810a35e646 | ||
|
|
ceaa1696fd | ||
|
|
4305800e09 | ||
|
|
53e5a0ac25 |
8 changed files with 76 additions and 23 deletions
|
|
@ -18,7 +18,7 @@
|
||||||
<QuickGrid Pagination="Pagination" Items="@ArchiveService.GetAllEntries().AsQueryable()">
|
<QuickGrid Pagination="Pagination" Items="@ArchiveService.GetAllEntries().AsQueryable()">
|
||||||
@if (ShowDate)
|
@if (ShowDate)
|
||||||
{
|
{
|
||||||
<PropertyColumn Property="@(e => e.date)" Format="yyyy.MM.dd" Sortable="true" InitialSortDirection="SortDirection.Descending" IsDefaultSortColumn="true" />
|
<PropertyColumn Property="@(e => e.date)" Format="dd.MM.yyyy" Sortable="true" InitialSortDirection="SortDirection.Descending" IsDefaultSortColumn="true" />
|
||||||
}
|
}
|
||||||
@if (ShowPizzaTotal)
|
@if (ShowPizzaTotal)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -7,10 +7,19 @@
|
||||||
}
|
}
|
||||||
@if (GlobalStuffService.Message.Length >= 2)
|
@if (GlobalStuffService.Message.Length >= 2)
|
||||||
{
|
{
|
||||||
<p style="font-size: 1.5em; color: limegreen;"> @GlobalStuffService.Message </p>
|
<div class="global_message"> @((MarkupString)Markdig.Markdown.ToHtml(GlobalStuffService.Message)) </div>
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.global_message > * {
|
||||||
|
color: limegreen;
|
||||||
|
}
|
||||||
|
|
||||||
|
.global_message > p {
|
||||||
|
font-size: 1.5em;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
||||||
@code{
|
@code{
|
||||||
protected override void OnInitialized()
|
protected override void OnInitialized()
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,20 +12,28 @@
|
||||||
|
|
||||||
|
|
||||||
<h4>Order Locking</h4>
|
<h4>Order Locking</h4>
|
||||||
<button @onclick="ToggleOrdersLocked" class="btn btn-danger">
|
@if (GlobalStuffService.OrdersLocked)
|
||||||
@if (GlobalStuffService.OrdersLocked)
|
{
|
||||||
{
|
<button @onclick="UnlockOrders" class="btn btn-danger">
|
||||||
<span>Unlock Orders</span>
|
<span>Unlock Orders</span>
|
||||||
}
|
</button>
|
||||||
else
|
}
|
||||||
{
|
else
|
||||||
|
{
|
||||||
|
<button @onclick="LockOrders" class="btn btn-danger">
|
||||||
<span>Lock Orders</span>
|
<span>Lock Orders</span>
|
||||||
}
|
</button>
|
||||||
</button>
|
}
|
||||||
|
|
||||||
|
@if (ShowUnlockConfirmation)
|
||||||
|
{
|
||||||
|
<p style="font-size: 1em; color: red;">Order(s) have already been marked as payed. If you unlock payment information WILL be lost!</p>
|
||||||
|
<button @onclick="ConfirmedUnlockOrders" class="btn btn-danger">I understand the consequences. Unlock anyways</button>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
<h4>Global Message</h4>
|
<h4>Global Message</h4>
|
||||||
<InputText @bind-Value=GlobalMessage id="Message" />
|
<InputTextArea @bind-Value=GlobalMessage id="Message" />
|
||||||
<button @onclick="SetGlobalMessage">
|
<button @onclick="SetGlobalMessage">
|
||||||
Confirm Message
|
Confirm Message
|
||||||
</button>
|
</button>
|
||||||
|
|
@ -136,15 +144,33 @@
|
||||||
bool WrongDeletionPasscode = false;
|
bool WrongDeletionPasscode = false;
|
||||||
string DeletionPasscode = "";
|
string DeletionPasscode = "";
|
||||||
|
|
||||||
|
bool ShowUnlockConfirmation = false;
|
||||||
|
|
||||||
void SaveNewPizzaConfig(EditContext editContext)
|
void SaveNewPizzaConfig(EditContext editContext)
|
||||||
{
|
{
|
||||||
GlobalStuffService.SetConfig(PConfig);
|
GlobalStuffService.SetConfig(PConfig);
|
||||||
GlobalStuffService.ShouldBalance = true;
|
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()
|
void SetGlobalMessage()
|
||||||
|
|
@ -164,4 +190,4 @@
|
||||||
{
|
{
|
||||||
PConfig = GlobalStuffService.GetConfig() ?? new PizzaConfig();
|
PConfig = GlobalStuffService.GetConfig() ?? new PizzaConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,8 @@
|
||||||
<ValidationMessage For="() => Order.Name" />
|
<ValidationMessage For="() => Order.Name" />
|
||||||
</div>
|
</div>
|
||||||
<label for="PiecesGroup" style="margin-top: 1em;">Pieces</label>
|
<label for="PiecesGroup" style="margin-top: 1em;">Pieces</label>
|
||||||
<span style="font-size: 0.7em;">One slice = ca. @GlobalStuffService.GetSizeOfSliceInCM2().ToString("F0") cm<sup>2</sup></span>
|
<span style="font-size: 0.6em; color: gray;">One slice = ca. @GlobalStuffService.GetSizeOfSliceInCM2().ToString("F0") cm<sup>2</sup></span>
|
||||||
|
<PricePerPieceDisplay />
|
||||||
<div class="row" id="PiecesGroup">
|
<div class="row" id="PiecesGroup">
|
||||||
<div class="form-group col">
|
<div class="form-group col">
|
||||||
<label for="meatPieces">🍖</label>
|
<label for="meatPieces">🍖</label>
|
||||||
|
|
@ -49,7 +50,8 @@
|
||||||
<label for="priorityMeat" style="text-align:center;"> Priority </label>
|
<label for="priorityMeat" style="text-align:center;"> Priority </label>
|
||||||
<p style="text-align:center; font-size: 0.8em; margin: 0;">
|
<p style="text-align:center; font-size: 0.8em; margin: 0;">
|
||||||
The balancing algorithm tries to avoid changes of the corresponding Variable <br />
|
The balancing algorithm tries to avoid changes of the corresponding Variable <br />
|
||||||
<i style="font-size: 0.8em;">E.g. If you want to only get pieces from your chosen category put the slider all the way to the left</i></p>
|
<i style="font-size: 0.8em;">E.g. If you want to only get pieces from your chosen category put the slider all the way to the left</i>
|
||||||
|
</p>
|
||||||
|
|
||||||
<div class="priority-slider-container">
|
<div class="priority-slider-container">
|
||||||
<div> Category </div>
|
<div> Category </div>
|
||||||
|
|
@ -57,7 +59,7 @@
|
||||||
<div> Total Count</div>
|
<div> Total Count</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" value="Submit" class="btn btn-primary"/>
|
<input type="submit" value="Submit" class="btn btn-primary" />
|
||||||
</EditForm>
|
</EditForm>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
|
@ -78,10 +80,10 @@
|
||||||
margin: 2rem 3px;
|
margin: 2rem 3px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.priority-slider-container{
|
.priority-slider-container {
|
||||||
padding-bottom: 1rem;
|
padding-bottom: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction:row;
|
flex-direction: row;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
gap: 1em;
|
gap: 1em;
|
||||||
font-size: 0.75em;
|
font-size: 0.75em;
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,8 @@
|
||||||
@Order.Name
|
@Order.Name
|
||||||
</h3>
|
</h3>
|
||||||
<label for="PiecesGroup" style="margin-top: 1em;">Pieces</label>
|
<label for="PiecesGroup" style="margin-top: 1em;">Pieces</label>
|
||||||
<span style="font-size: 0.7em;">One slice = ca. @GlobalStuffService.GetSizeOfSliceInCM2().ToString("F0") cm<sup>2</sup></span>
|
<span style="font-size: 0.6em; color: gray;">One slice = ca. @GlobalStuffService.GetSizeOfSliceInCM2().ToString("F0") cm<sup>2</sup></span>
|
||||||
|
<PricePerPieceDisplay />
|
||||||
<div class="row" id="PiecesGroup">
|
<div class="row" id="PiecesGroup">
|
||||||
<div class="form-group col">
|
<div class="form-group col">
|
||||||
<label for="meatPieces">🍖</label>
|
<label for="meatPieces">🍖</label>
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,10 @@
|
||||||
<PageTitle>Pizza List</PageTitle>
|
<PageTitle>Pizza List</PageTitle>
|
||||||
|
|
||||||
<div style="display: flex; ">
|
<div style="display: flex; ">
|
||||||
|
<div style="display: flex; flex-direction:column;">
|
||||||
<TotalPizzasDisplay />
|
<TotalPizzasDisplay />
|
||||||
|
<PricePerPieceDisplay />
|
||||||
|
</div>
|
||||||
<div style ="display: flex; flex-direction:column; margin-left:auto; align-items:flex-end;">
|
<div style ="display: flex; flex-direction:column; margin-left:auto; align-items:flex-end;">
|
||||||
<OrderButton />
|
<OrderButton />
|
||||||
<HelpButton />
|
<HelpButton />
|
||||||
|
|
|
||||||
11
PizzaBot/Components/PricePerPieceDisplay.razor
Normal file
11
PizzaBot/Components/PricePerPieceDisplay.razor
Normal file
|
|
@ -0,0 +1,11 @@
|
||||||
|
@inject GlobalStuffService GlobalStuffService
|
||||||
|
@using System.Globalization
|
||||||
|
|
||||||
|
<p>Price per 🍕: @((GlobalStuffService.GetConfig().Price / (GlobalStuffService.GetConfig().Fragments * 100.0f)).ToString("C2", CultureInfo.CreateSpecificCulture("de-DE")))</p>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
p{
|
||||||
|
font-size: 0.6em;
|
||||||
|
color: gray;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|
@ -15,6 +15,7 @@
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<PackageReference Include="Markdig" Version="0.37.0" />
|
||||||
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="8.0.2" />
|
<PackageReference Include="Microsoft.AspNetCore.Components.QuickGrid" Version="8.0.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" />
|
<PackageReference Include="Microsoft.EntityFrameworkCore" Version="7.0.2" />
|
||||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0">
|
<PackageReference Include="Microsoft.EntityFrameworkCore.Tools" Version="7.0.0">
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue