Add club settings and use club name in PDF exports
This commit is contained in:
@@ -4,9 +4,14 @@
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>Übersicht</h2>
|
||||
<button class="btn btn-primary" @onclick="() => showAddAccount = true">
|
||||
<i class="bi bi-plus-lg"></i> Neues Konto
|
||||
</button>
|
||||
<div class="d-flex gap-2">
|
||||
<button class="btn btn-primary" @onclick="() => showAddAccount = true">
|
||||
<i class="bi bi-plus-lg"></i> Neues Konto
|
||||
</button>
|
||||
<a class="btn btn-outline-secondary" href="/settings">
|
||||
<i class="bi bi-gear"></i> Einstellungen
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@if (accounts == null)
|
||||
|
||||
50
src/Duempelkas.App/Pages/Settings.razor
Normal file
50
src/Duempelkas.App/Pages/Settings.razor
Normal file
@@ -0,0 +1,50 @@
|
||||
@page "/settings"
|
||||
@inject ISettingsService SettingsService
|
||||
|
||||
<div class="container-fluid">
|
||||
<div class="d-flex justify-content-between align-items-center mb-4">
|
||||
<h2>Einstellungen</h2>
|
||||
<a class="btn btn-outline-secondary" href="/">
|
||||
<i class="bi bi-arrow-left"></i> Zurück
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div class="card">
|
||||
<div class="card-body">
|
||||
<h5 class="card-title mb-3">Verein</h5>
|
||||
<div class="mb-3">
|
||||
<label class="form-label">Name des Vereins</label>
|
||||
<input type="text" class="form-control" @bind="clubName" @bind:event="oninput"
|
||||
placeholder="Mein Verein" />
|
||||
<div class="form-text">Wird im PDF-Auszug als Kopfzeile verwendet.</div>
|
||||
</div>
|
||||
<button class="btn btn-primary" @onclick="Save" disabled="@saving">
|
||||
<i class="bi bi-check-lg"></i> Speichern
|
||||
</button>
|
||||
@if (saved)
|
||||
{
|
||||
<span class="text-success ms-2"><i class="bi bi-check-circle"></i> Gespeichert</span>
|
||||
}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@code {
|
||||
private string clubName = string.Empty;
|
||||
private bool saving;
|
||||
private bool saved;
|
||||
|
||||
protected override async Task OnInitializedAsync()
|
||||
{
|
||||
clubName = await SettingsService.GetClubNameAsync() ?? string.Empty;
|
||||
}
|
||||
|
||||
private async Task Save()
|
||||
{
|
||||
saving = true;
|
||||
saved = false;
|
||||
await SettingsService.SetClubNameAsync(clubName);
|
||||
saved = true;
|
||||
saving = false;
|
||||
}
|
||||
}
|
||||
7
src/Duempelkas.App/Services/ISettingsService.cs
Normal file
7
src/Duempelkas.App/Services/ISettingsService.cs
Normal file
@@ -0,0 +1,7 @@
|
||||
namespace Duempelkas.App.Services;
|
||||
|
||||
public interface ISettingsService
|
||||
{
|
||||
Task<string?> GetClubNameAsync();
|
||||
Task SetClubNameAsync(string? clubName);
|
||||
}
|
||||
Reference in New Issue
Block a user