46 lines
1.5 KiB
Plaintext
46 lines
1.5 KiB
Plaintext
@page "/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>Cocktails</label>
|
|
</SectionContent>
|
|
<!--
|
|
<p>
|
|
<a href="/cocktails/add">Cocktail hinzufügen</a>
|
|
</p>
|
|
-->
|
|
<div class="container py-2 border border-5 overflow-auto d-inline-block">
|
|
<div class="row flex-nowrap">
|
|
@foreach (Cocktail c in CocktailListe)
|
|
{
|
|
<div class="col">
|
|
<a href="/cocktails/@c.Id">
|
|
<div class="card" style="width: 18rem;">
|
|
@if (c.ImageURL != null && File.Exists(Path.Join(env.WebRootPath, c.ImageURL)))
|
|
{
|
|
<img class="card-img-top" src="@($"/{c.ImageURL}")" alt="@c.Name">
|
|
}
|
|
else
|
|
{
|
|
<img class="card-img-top mh-50" src="@($"/img/cocktail-default.jpg")" alt="@c.Name">
|
|
}
|
|
<div class="card-body">
|
|
<h5 class="card-title">@c.Name</h5>
|
|
<!--<p class="card-text">
|
|
Testy
|
|
</p>-->
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
}
|
|
</div>
|
|
</div>
|
|
|