2024-02-07 19:53:05 +01:00

56 lines
2.1 KiB
Plaintext

@page "/settings/maschine";
@using Microsoft.EntityFrameworkCore
@using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections
@using CocktailWeb.Shared
@inject IDbContextFactory<DbDataContext> DataContextFactory;
<PageTitle>Maschineneinstellungen</PageTitle>
<SectionContent SectionId="TopRow.Title">
<label>Einstellungen - Maschine</label>
</SectionContent>
<div class="container">
<h4>Ausgießer</h4>
<div class="row pb-2 gap-2" style="height:45vh">
@foreach (Filler f in Fillers.Where(f => f.Type == Filler.FillerType.Pourer))
{
<a class="col border border-1 rounded-2 text-decoration-none text-light" @onclick="args => OpenSelectionDialog(args,f)">
@f.Pos - @f.Flasche?.Name
</a>
}
</div>
<h4>Pumpen</h4>
<div class="row gap-2" style="height:25vh">
@foreach (Filler f in Fillers.Where(f => f.Type == Filler.FillerType.Pump))
{
<a class="col border border-1 rounded-2 text-decoration-none text-light" @onclick="args => OpenSelectionDialog(args,f)">
@f.Pos - @f.Flasche?.Name
</a>
}
</div>
</div>
<ModalComponent @ref="modal">
<Title>Flasche auswählen</Title>
<Body>
<ul class="list-group">
<li class="list-group-item list-group-item-action align-middle @(SelectedFlasche == null ? "text-bg-success" : "")" @onclick="args => SelectFlasche(args,null)">
<label class="form-check-label stretched-link">(Leer)</label>
</li>
@foreach (Flasche fl in Flaschen)
{
<li class="list-group-item list-group-item-action align-middle @(SelectedFlasche == fl ? "text-bg-success" : "")" @onclick="args => SelectFlasche(args,fl)">
<label class="form-check-label stretched-link">@fl.Name</label>
</li>
}
</ul>
</Body>
<Footer>
<button type="button" class="btn btn-secondary" @onclick="CloseDialog">Abbrechen</button>
<button type="button" class="btn btn-primary" @onclick="SaveSelection">Speichern</button>
</Footer>
</ModalComponent>