50 lines
1.7 KiB
Plaintext
50 lines
1.7 KiB
Plaintext
@page "/"
|
|
@page "/cocktails"
|
|
@using CocktailWeb.Data
|
|
@using Microsoft.AspNetCore.Components.Sections
|
|
@using Microsoft.EntityFrameworkCore
|
|
@inject IDbContextFactory<DbDataContext> DataContextFactory;
|
|
@inject IWebHostEnvironment env;
|
|
|
|
<PageTitle>Cocktails</PageTitle>
|
|
<SectionContent SectionId="TopRow.Title">
|
|
<label>Cocktails</label>
|
|
</SectionContent>
|
|
|
|
<div class="card-group gap-3 flex-nowrap">
|
|
@foreach (Cocktail c in CocktailListe)
|
|
{
|
|
<div class="col">
|
|
<a class="text-decoration-none text-black;" href="/cocktails/@c.Id">
|
|
<div class="card" style="width: 20vw; min-width:15rem; max-height:350px; ">
|
|
|
|
@if (c.ImageURL != null && File.Exists(Path.Join(env.WebRootPath, c.ImageURL)))
|
|
{
|
|
<img class="card-img-top" style="width:100%; min-height:70vh; object-fit:cover;" src="@($"/{c.ImageURL}")" alt="@c.Name">
|
|
}
|
|
else
|
|
{
|
|
|
|
<img class="card-img-top" style="width:100%; min-height:70vh; object-fit:cover;" src="@($"/img/cocktail-default.jpg")" alt="@c.Name">
|
|
}
|
|
<div class="card-footer">
|
|
<h5 class="card-title">
|
|
@c.Name
|
|
@if(!c.IsAlcoholic)
|
|
{
|
|
<i class="bi bi-car-front ms-2 text-info"></i>
|
|
}
|
|
</h5>
|
|
<!--<p class="card-text">
|
|
Testy
|
|
</p>-->
|
|
</div>
|
|
</div>
|
|
</a>
|
|
</div>
|
|
}
|
|
|
|
</div>
|
|
|
|
|