Compare commits
3 commits
bb5ae96b31
...
a03812f6ee
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a03812f6ee | ||
|
|
74e499c550 | ||
|
|
493f76ee89 |
2 changed files with 64 additions and 9 deletions
|
|
@ -2,21 +2,58 @@
|
||||||
|
|
||||||
@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" />
|
<PropertyColumn Property="@(e => e.date)" Format="yyyy.MM.dd" Sortable="true" InitialSortDirection="SortDirection.Descending" IsDefaultSortColumn="true" />
|
||||||
@if (ShowOnlyTotalPizza)
|
}
|
||||||
|
@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" />
|
<PropertyColumn Title="🍾" Property="@(e => e.Bottles)" Sortable="false" />
|
||||||
|
}
|
||||||
|
@if (ShowPrice)
|
||||||
|
{
|
||||||
<PropertyColumn Title="€" Property="@(e=>e.TotalCost)" />
|
<PropertyColumn Title="€" Property="@(e=>e.TotalCost)" />
|
||||||
|
}
|
||||||
|
@if (ShowNotes)
|
||||||
|
{
|
||||||
|
<PropertyColumn Title="Notes" Property="@(e=>e.Annotation)" />
|
||||||
|
}
|
||||||
|
@if (ShowEdit)
|
||||||
|
{
|
||||||
<TemplateColumn Title="🔧" Sortable="false">
|
<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>
|
<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>
|
</TemplateColumn>
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
</QuickGrid>
|
</QuickGrid>
|
||||||
<Paginator State="@Pagination" />
|
<Paginator State="@Pagination" />
|
||||||
|
|
||||||
|
|
@ -36,6 +73,16 @@
|
||||||
|
|
||||||
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();
|
||||||
|
|
@ -46,5 +93,13 @@
|
||||||
await InvokeAsync(StateHasChanged);
|
await InvokeAsync(StateHasChanged);
|
||||||
};
|
};
|
||||||
ArchiveService.OnArchiveChange += Reload;
|
ArchiveService.OnArchiveChange += Reload;
|
||||||
|
|
||||||
|
if (ShowOnlyTotalPizza)
|
||||||
|
{
|
||||||
|
ShowPizzaDetailed = false;
|
||||||
|
ShowBottles = false;
|
||||||
|
ShowOrderCount = false;
|
||||||
|
//ShowEdit = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -22,7 +22,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
<span>Order's have to be locked to add today to the archive.</span>
|
<span>Orders have to be locked to add today to the archive.</span>
|
||||||
}
|
}
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue