Compare commits

..

No commits in common. "a03812f6eeecad367cd07f8115ec1eb38c3c3030" and "bb5ae96b31161b498e1ac314c329cacfd131cb6c" have entirely different histories.

2 changed files with 9 additions and 64 deletions

View file

@ -2,58 +2,21 @@
@using Microsoft.AspNetCore.Components.QuickGrid @using Microsoft.AspNetCore.Components.QuickGrid
<p>
Show:
<label><input type="checkbox" @bind="ShowDate" /> Date</label>
<label><input type="checkbox" @bind="ShowPizzaTotal" /> Pizzas</label>
<label><input type="checkbox" @bind="ShowPizzaDetailed" /> 🍖🍄🧀🌽</label>
<label><input type="checkbox" @bind="ShowOrderCount" /> order count</label>
<label><input type="checkbox" @bind="ShowBottles" /> 🍾</label>
<label><input type="checkbox" @bind="ShowPrice" /> Price</label>
<label><input type="checkbox" @bind="ShowNotes" /> Notes</label>
<label><input type="checkbox" @bind="ShowEdit" /> Edit Button</label>
</p>
<QuickGrid Pagination="Pagination" Items="@ArchiveService.GetAllEntries().AsQueryable()"> <QuickGrid Pagination="Pagination" Items="@ArchiveService.GetAllEntries().AsQueryable()">
@if (ShowDate) <PropertyColumn Property="@(e => e.date)" Format="yyyy.MM.dd" Sortable="true" InitialSortDirection="SortDirection.Descending" IsDefaultSortColumn="true" />
{ @if (ShowOnlyTotalPizza)
<PropertyColumn Property="@(e => e.date)" Format="yyyy.MM.dd" Sortable="true" InitialSortDirection="SortDirection.Descending" IsDefaultSortColumn="true" />
}
@if (ShowPizzaTotal)
{ {
<PropertyColumn Title="Pizzas" Property="@(e => (e.MeatPizzas + e.VeggiePizzas + e.VeganPizzas))" Sortable="true" /> <PropertyColumn Title="Pizzas" Property="@(e => (e.MeatPizzas + e.VeggiePizzas + e.VeganPizzas))" Sortable="true" />
} } else{
@if (ShowPizzaDetailed)
{
<PropertyColumn Title="🍖" Property="@(e => e.MeatPizzas)" Sortable="false" /> <PropertyColumn Title="🍖" Property="@(e => e.MeatPizzas)" Sortable="false" />
<PropertyColumn Title="🍄🧀" Property="@(e => e.VeggiePizzas)" Sortable="false" /> <PropertyColumn Title="🍄🧀" Property="@(e => e.VeggiePizzas)" Sortable="false" />
<PropertyColumn Title="🌽" Property="@(e => e.VeganPizzas)" Sortable="false" /> <PropertyColumn Title="🌽" Property="@(e => e.VeganPizzas)" Sortable="false" />
}
@if (ShowOrderCount)
{
<PropertyColumn Title="🧑" Property="@(e => e.AnonymizedOrders.Count)" Sortable="false" />
}
@if (ShowBottles)
{
<PropertyColumn Title="🍾" Property="@(e => e.Bottles)" Sortable="false" />
} }
@if (ShowPrice) <PropertyColumn Title="🍾" Property="@(e => e.Bottles)" Sortable="false" />
{ <PropertyColumn Title="€" Property="@(e=>e.TotalCost)" />
<PropertyColumn Title="€" Property="@(e=>e.TotalCost)" /> <TemplateColumn Title="🔧" Sortable="false">
} <a href="/admin@(SecretPath)/archive/@(context.id)"><button class="btn btn-info" style="width: 2em; height: 2em; padding: 0; text-align:center;">🔧</button></a>
@if (ShowNotes) </TemplateColumn>
{
<PropertyColumn Title="Notes" Property="@(e=>e.Annotation)" />
}
@if (ShowEdit)
{
<TemplateColumn Title="🔧" Sortable="false">
<a href="/admin@(SecretPath)/archive/@(context.id)"><button class="btn btn-info" style="width: 2em; height: 2em; padding: 0; text-align:center;">🔧</button></a>
</TemplateColumn>
}
</QuickGrid> </QuickGrid>
<Paginator State="@Pagination" /> <Paginator State="@Pagination" />
@ -73,16 +36,6 @@
PaginationState Pagination; PaginationState Pagination;
bool ShowDate = true;
bool ShowPizzaTotal = true;
bool ShowPizzaDetailed = true;
bool ShowOrderCount = true;
bool ShowBottles = true;
bool ShowPrice = true;
bool ShowEdit = true;
bool ShowNotes = false;
protected override void OnInitialized() protected override void OnInitialized()
{ {
base.OnInitialized(); base.OnInitialized();
@ -93,13 +46,5 @@
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
}; };
ArchiveService.OnArchiveChange += Reload; ArchiveService.OnArchiveChange += Reload;
if (ShowOnlyTotalPizza)
{
ShowPizzaDetailed = false;
ShowBottles = false;
ShowOrderCount = false;
//ShowEdit = false;
}
} }
} }

View file

@ -22,7 +22,7 @@
} }
else else
{ {
<span>Orders have to be locked to add today to the archive.</span> <span>Order's have to be locked to add today to the archive.</span>
} }
<hr> <hr>