Compare commits

..
3 Commits
Author SHA1 Message Date
BuildTools 4b779dabbe Bearbeiten der Maschine weitergebaut 2024-02-05 19:16:51 +01:00
BuildTools 5aae28d7ab Theme auf Darkmode angepasst 2024-02-05 19:16:27 +01:00
BuildTools 60a27f08b2 Fehler beim Bearbeiten von Cocktails behoben 2024-02-05 19:15:24 +01:00
10 changed files with 106 additions and 14 deletions

No files matched your search

Binary file not shown.
+1
View File
@@ -1,4 +1,5 @@
@page "/" @page "/"
@page "/cocktails"
@using CocktailWeb.Data @using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections @using Microsoft.AspNetCore.Components.Sections
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@@ -27,7 +27,7 @@
</div> </div>
<h5>Cocktail-Zutaten</h5> <h5>Cocktail-Zutaten</h5>
<table class="table align-middle"> <table class="table table-dark align-middle">
<tbody> <tbody>
@if (EditCocktail.Cocktailflaschen.Count == 0) @if (EditCocktail.Cocktailflaschen.Count == 0)
{ {
@@ -24,7 +24,7 @@ namespace CocktailWeb.Pages.Settings
_DataContext ??= await DataContextFactory.CreateDbContextAsync(); _DataContext ??= await DataContextFactory.CreateDbContextAsync();
if (_DataContext != null) if (_DataContext != null)
{ {
EditCocktail = _DataContext.Cocktails.Include(c => c.Cocktailflaschen).ThenInclude(cf => cf.Flasche).Single(c => c.Id == Convert.ToInt32(id)); EditCocktail = _DataContext.Cocktails.Include(c => c.Cocktailflaschen).ThenInclude(cf => cf.Flasche).Single(c => c.Id == Convert.ToInt32(id));
} }
} }
// Falls keine ID angegeben wurde oder der Cocktail in der Datenbank nicht gefunden wurde, gehen wir davon aus dass ein neuer Cocktail erstellt wird. // Falls keine ID angegeben wurde oder der Cocktail in der Datenbank nicht gefunden wurde, gehen wir davon aus dass ein neuer Cocktail erstellt wird.
@@ -34,7 +34,7 @@ namespace CocktailWeb.Pages.Settings
} }
await FillFlaschenListe(); await FillFlaschenListe();
await InvokeAsync(StateHasChanged); await InvokeAsync(StateHasChanged);
} }
public async Task FillFlaschenListe() public async Task FillFlaschenListe()
@@ -89,7 +89,14 @@ namespace CocktailWeb.Pages.Settings
if (EditCocktail != null && _DataContext != null) if (EditCocktail != null && _DataContext != null)
{ {
_DataContext.Cocktails.Add(EditCocktail); if (id != null)
{
_DataContext.Cocktails.Update(EditCocktail);
}
else
{
_DataContext.Cocktails.Add(EditCocktail);
}
await _DataContext.SaveChangesAsync(); await _DataContext.SaveChangesAsync();
if (CocktaiLBildDatei != null) if (CocktaiLBildDatei != null)
+1 -1
View File
@@ -14,7 +14,7 @@
<a class="btn btn-primary mb-3" href="/settings/cocktails/edit">Cocktail hinzufügen</a> <a class="btn btn-primary mb-3" href="/settings/cocktails/edit">Cocktail hinzufügen</a>
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-light border-dark"> <table class="table table-striped table-hover table-bordered table-dark border-dark">
<tbody> <tbody>
@foreach (Cocktail c in CocktailListe) @foreach (Cocktail c in CocktailListe)
{ {
+1 -1
View File
@@ -38,7 +38,7 @@ else
@if (FlaschenListe != null && FlaschenListe.Count > 0) @if (FlaschenListe != null && FlaschenListe.Count > 0)
{ {
<div class="table-responsive"> <div class="table-responsive">
<table class="table table-striped table-hover table-bordered table-light border-dark"> <table class="table table-striped table-hover table-bordered table-dark border-dark">
<thead> <thead>
<tr> <tr>
<!--<th scope="col">ID</th>--> <!--<th scope="col">ID</th>-->
+76 -2
View File
@@ -2,12 +2,86 @@
@using Microsoft.EntityFrameworkCore @using Microsoft.EntityFrameworkCore
@using CocktailWeb.Data @using CocktailWeb.Data
@using Microsoft.AspNetCore.Components.Sections @using Microsoft.AspNetCore.Components.Sections
@inject IDbContextFactory<DbDataContext> FlascheDataContextFactory; @inject IDbContextFactory<DbDataContext> DataContextFactory;
<PageTitle>Maschine</PageTitle> <PageTitle>Maschineneinstellungen</PageTitle>
<SectionContent SectionId="TopRow.Title"> <SectionContent SectionId="TopRow.Title">
<label>Einstellungen - Maschine</label> <label>Einstellungen - Maschine</label>
</SectionContent> </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" href="#" data-bs-toggle="modal" data-bs-target="#examplemodal">
@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" href="#" data-bs-toggle="modal" data-bs-target="#examplemodal">
@f.Pos - @f.Flasche?.Name
</a>
}
</div>
</div>
<div class="modal fade" id="examplemodal" tabindex="-1" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable">
<div class="modal-content">
<div class="modal-header">
Testdialog
</div>
<div class="modal-body">
<ul class="list-group">
@if (Flaschen.Count == 0)
{
<li class="list-group-item list-group-item-action align-middle">
Es wurden noch keine Zutaten angelegt
</li>
}
else
{
@foreach (Flasche fl in Flaschen)
{
<li class="list-group-item list-group-item-action align-middle">
<label class="form-check-label stretched-link">@fl.Name</label>
</li>
}
}
</ul>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Abbrechen</button>
<button type="button" class="btn btn-primary">Speichern</button>
</div>
</div>
</div>
</div>
@code {
private DbDataContext? _DataContext;
private List<Filler> Fillers { get; set; } = new();
private List<Flasche> Flaschen { get; set; } = new();
protected override async Task OnInitializedAsync()
{
await ShowFillers();
}
private async Task ShowFillers()
{
_DataContext ??= await DataContextFactory.CreateDbContextAsync();
if (_DataContext != null)
{
Fillers = await _DataContext.Fillers.Include(f => f.Flasche).OrderBy(f => f.Pos).ToListAsync();
Flaschen = await _DataContext.Flaschen.OrderBy(fl => fl.Name).ToListAsync();
}
}
}
+1 -1
View File
@@ -9,7 +9,7 @@
<meta charset="utf-8" /> <meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" />
<base href="~/" /> <base href="~/" />
<link rel="stylesheet" href="css/bootstrap/bootstrap.min.css" /> <link rel="stylesheet" href="css/bootstrap/bootstrap.dark.min.css" />
<link href="css/site.css" rel="stylesheet" /> <link href="css/site.css" rel="stylesheet" />
<link href="CocktailWeb.styles.css" rel="stylesheet" /> <link href="CocktailWeb.styles.css" rel="stylesheet" />
<link rel="icon" type="image/png" href="favicon.png"/> <link rel="icon" type="image/png" href="favicon.png"/>
+3 -5
View File
@@ -1,16 +1,14 @@
@using Microsoft.AspNetCore.Components.Sections @using Microsoft.AspNetCore.Components.Sections
<div class="d-flex fixed-top justify-content-between px-4" style="background-color: #f7f7f7; border-bottom: 1px solid #d6d5d5; height: 56px; align-items: center; top: 0; z-index: 1;"> <div class="d-flex align-items-center fixed-top justify-content-between px-4 bg-dark border-primary-subtle" style="border-bottom: 1px solid #d6d5d5; height: 56px; align-items: center; top: 0; z-index: 1;">
<div class="d-flex gap-3"> <div class="d-flex gap-3 align-items-center">
<a class="btn btn-primary" href="/"> <a class="btn btn-primary" href="/">
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-house" viewBox="0 0 16 16"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" class="bi bi-house" viewBox="0 0 16 16">
<path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z" /> <path d="M8.707 1.5a1 1 0 0 0-1.414 0L.646 8.146a.5.5 0 0 0 .708.708L2 8.207V13.5A1.5 1.5 0 0 0 3.5 15h9a1.5 1.5 0 0 0 1.5-1.5V8.207l.646.647a.5.5 0 0 0 .708-.708L13 5.793V2.5a.5.5 0 0 0-.5-.5h-1a.5.5 0 0 0-.5.5v1.293zM13 7.207V13.5a.5.5 0 0 1-.5.5h-9a.5.5 0 0 1-.5-.5V7.207l5-5z" />
</svg> </svg>
</a> </a>
<h3> <SectionOutlet SectionId="Title" />
<SectionOutlet SectionId="Title" />
</h3>
</div> </div>
<div class="dropdown show"> <div class="dropdown show">
@@ -0,0 +1,12 @@
@charset "UTF-8";/*!
* Bootswatch v5.3.2 (https://bootswatch.com)
* Theme: darkly
* Copyright 2012-2023 Thomas Park
* Licensed under MIT
* Based on Bootstrap
*//*!
* Bootstrap v5.3.2 (https://getbootstrap.com/)
* Copyright 2011-2023 The Bootstrap Authors
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/main/LICENSE)
*/@import url(https://fonts.googleapis.com/css2?family=Lato:ital,wght@0,400;0,700;1,400&display=swap);:root,[data-bs-theme=light]{--bs-blue:#375a7f;--bs-indigo:#6610f2;--bs-purple:#6f42c1;--bs-pink:#e83e8c;--bs-red:#e74c3c;--bs-orange:#fd7e14;--bs-yellow:#f39c12;--bs-green:#00bc8c;--bs-teal:#20c997;--bs-cyan:#3498db;--bs-black:#000;--bs-white:#fff;--bs-gray:#888;--bs-gray-dark:#303030;--bs-gray-100:#f8f9fa;--bs-gray-200:#ebebeb;--bs-gray-300:#dee2e6;--bs-gray-400:#ced4da;--bs-gray-500:#adb5bd;--bs-gray-600:#888;--bs-gray-700:#444;--bs-gray-800:#303030;--bs-gray-900:#222;--bs-primary:#375a7f;--bs-secondary:#444;--bs-success:#00bc8c;--bs-info:#3498db;--bs-warning:#f39c12;--bs-danger:#e74c3c;--bs-light:#adb5bd;--bs-dark:#303030;--bs-primary-rgb:55,90,127;--bs-secondary-rgb:68,68,68;--bs-success-rgb:0,188,140;--bs-info-rgb:52,152,219;--bs-warning-rgb:243,156,18;--bs-danger-rgb:231,76,60;--bs-light-rgb:173,181,189;--bs-dark-rgb:48,48,48;--bs-primary-text-emphasis:#162433;--bs-secondary-text-emphasis:#1b1b1b;--bs-success-text-emphasis:#004b38;--bs-info-text-emphasis:#153d58;--bs-warning-text-emphasis:#613e07;--bs-danger-text-emphasis:#5c1e18;--bs-light-text-emphasis:#444;--bs-dark-text-emphasis:#444;--bs-primary-bg-subtle:#d7dee5;--bs-secondary-bg-subtle:#dadada;--bs-success-bg-subtle:#ccf2e8;--bs-info-bg-subtle:#d6eaf8;--bs-warning-bg-subtle:#fdebd0;--bs-danger-bg-subtle:#fadbd8;--bs-light-bg-subtle:#fcfcfd;--bs-dark-bg-subtle:#ced4da;--bs-primary-border-subtle:#afbdcc;--bs-secondary-border-subtle:#b4b4b4;--bs-success-border-subtle:#99e4d1;--bs-info-border-subtle:#aed6f1;--bs-warning-border-subtle:#fad7a0;--bs-danger-border-subtle:#f5b7b1;--bs-light-border-subtle:#ebebeb;--bs-dark-border-subtle:#adb5bd;--bs-white-rgb:255,255,255;--bs-black-rgb:0,0,0;--bs-font-sans-serif:Lato,-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif,"Apple Color Emoji","Segoe UI Emoji","Segoe UI Symbol";--bs-font-monospace:SFMono-Regular,Menlo,Monaco,Consolas,"Liberation Mono","Courier New",monospace;--bs-gradient:linear-gradient(180deg, rgba(255, 255, 255, 0.15), rgba(255, 255, 255, 0));--bs-body-font-family:var(--bs-font-sans-serif);--bs-body-font-size:1rem;--bs-body-font-weight:400;--bs-body-line-height:1.5;--bs-body-color:#fff;--bs-body-color-rgb:255,255,255;--bs-body-bg:#222;--bs-body-bg-rgb:34,34,34;--bs-emphasis-color:#000;--bs-emphasis-color-rgb:0,0,0;--bs-secondary-color:rgba(255, 255, 255, 0.75);--bs-secondary-color-rgb:255,255,255;--bs-secondary-bg:#ebebeb;--bs-secondary-bg-rgb:235,235,235;--bs-tertiary-color:rgba(255, 255, 255, 0.5);--bs-tertiary-color-rgb:255,255,255;--bs-tertiary-bg:#f8f9fa;--bs-tertiary-bg-rgb:248,249,250;--bs-heading-color:inherit;--bs-link-color:#00bc8c;--bs-link-color-rgb:0,188,140;--bs-link-decoration:underline;--bs-link-hover-color:#009670;--bs-link-hover-color-rgb:0,150,112;--bs-code-color:#e83e8c;--bs-highlight-color:#fff;--bs-highlight-bg:#fdebd0;--bs-border-width:1px;--bs-border-style:solid;--bs-border-color:#dee2e6;--bs-border-color-translucent:rgba(0, 0, 0, 0.175);--bs-border-radius:0.375rem;--bs-border-radius-sm:0.25rem;--bs-border-radius-lg:0.5rem;--bs-border-radius-xl:1rem;--bs-border-radius-xxl:2rem;--bs-border-radius-2xl:var(--bs-border-radius-xxl);--bs-border-radius-pill:50rem;--bs-box-shadow:0 0.5rem 1rem rgba(0, 0, 0, 0.15);--bs-box-shadow-sm:0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);--bs-box-shadow-lg:0 1rem 3rem rgba(0, 0, 0, 0.175);--bs-box-shadow-inset:inset 0 1px 2px rgba(0, 0, 0, 0.075);--bs-focus-ring-width:0.25rem;--bs-focus-ring-opacity:0.25;--bs-focus-ring-color:rgba(55, 90, 127, 0.25);--bs-form-valid-color:#00bc8c;--bs-form-valid-border-color:#00bc8c;--bs-form-invalid-color:#e74c3c;--bs-form-invalid-border-color:#e74c3c}[data-bs-theme=dark]{color-scheme:dark;--bs-body-color:#dee2e6;--bs-body-color-rgb:222,226,230;--bs-body-bg:#222;--bs-body-bg-rgb:34,34,34;--bs-emphasis-color:#fff;--bs-emphasis-color-rgb:255,255,255;--bs-secondary-color:rgba(222, 226, 230, 0.75);--bs-secondary-color-rgb:222,226,230;--bs-secondary-bg:#303030;--bs-secondary-bg-rgb:48,48,48;--bs-tertiary-color:rgba(222, 226, 230, 0.5);--bs-tertiary-color-rgb:222,226,230;--bs-tertiary-bg:#292929;--bs-tertiary-bg-rgb:41,41,41;--bs-primary-text-emphasis:#879cb2;--bs-secondary-text-emphasis:#8f8f8f;--bs-success-text-emphasis:#66d7ba;--bs-info-text-emphasis:#85c1e9;--bs-warning-text-emphasis:#f8c471;--bs-danger-text-emphasis:#f1948a;--bs-light-text-emphasis:#f8f9fa;--bs-dark-text-emphasis:#dee2e6;--bs-primary-bg-subtle:#0b1219;--bs-secondary-bg-subtle:#0e0e0e;--bs-success-bg-subtle:#00261c;--bs-info-bg-subtle:#0a1e2c;--bs-warning-bg-subtle:#311f04;--bs-danger-bg-subtle:#2e0f0c;--bs-light-bg-subtle:#303030;--bs-dark-bg-subtle:#181818;--bs-primary-border-subtle:#21364c;--bs-secondary-border-subtle:#292929;--bs-success-border-subtle:#007154;--bs-info-border-subtle:#1f5b83;--bs-warning-border-subtle:#925e0b;--bs-danger-border-subtle:#8b2e24;--bs-light-border-subtle:#444;--bs-dark-border-Line truncated
/*# sourceMappingURL=bootstrap.min.css.map */