44 lines
1.6 KiB
Plaintext

@page "/settings/cocktails"
@using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections
@using Microsoft.EntityFrameworkCore
@inject IDbContextFactory<DbDataContext> DataContextFactory;
@inject IWebHostEnvironment env;
<!--layout SideScrollLayout-->
<!--<h3>Cocktails</h3>-->
<SectionContent SectionId="TopRow.Title">
<label>Einstellungen - Cocktails</label>
</SectionContent>
<a class="btn btn-primary mb-3" href="/settings/cocktails/edit">Cocktail hinzufügen</a>
<div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-dark border-dark">
<tbody>
@foreach (Cocktail c in CocktailListe)
{
<tr>
<td class="p-0" style="width:64px"><img src="@c.ImageURL" style="max-width:100%; max-height:auto;" /></td>
<td style="vertical-align:middle;">@c.Name</td>
<td style="text-align:right; vertical-align:middle;" >
<a class="btn btn-primary" href="/settings/cocktails/edit/@c.Id">Bearbeiten</a>
<button name="submit" type="submit" class="btn btn-outline-danger" @onclick="() => ConfirmDelete(c)">Löschen</button>
</td>
</tr>
}
</tbody>
</table>
</div>
<ModalComponent @ref="modal">
<Title>Löschen bestätigen</Title>
<Body>
Willst du den Cocktail wirklich löschen?
</Body>
<Footer>
<button class="btn btn-danger" @onclick="DeleteCocktail">Jo</button>
<button class="btn btn-primary" @onclick="CloseDialog">Nee</button>
</Footer>
</ModalComponent>