Files
duempelkas/src/Duempelkas.App/Components/Accounts/EntryTable.razor
T

49 lines
2.4 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<div class="entry-filters">
<div><label for="entry-search">Buchungen suchen</label>
<input id="entry-search" type="search" class="form-control" @bind="searchText" @bind:event="oninput" placeholder="Beschreibung, Nummer, Datum oder Betrag" /></div>
<div><label for="entry-sort">Sortierung</label>
<select id="entry-sort" @bind="sort">
<option value="date-asc">Datum: älteste zuerst</option><option value="date-desc">Datum: neueste zuerst</option>
<option value="amount-asc">Betrag: aufsteigend</option><option value="amount-desc">Betrag: absteigend</option>
<option value="title">Beschreibung: A–Z</option>
</select></div>
<button type="button" class="btn btn-outline-secondary filter-reset" @onclick="ResetFilters">Filter zurücksetzen</button>
</div>
@if (!string.IsNullOrWhiteSpace(searchText))
{
<p class="search-summary" role="status">@VisibleEntries.Count Treffer. Summe der wirksamen Treffer: @ResultSum.ToString("N2", System.Globalization.CultureInfo.GetCultureInfo("de-DE")) €.
Der Kontostand des gewählten Zeitraums oben bleibt unverändert.</p>
}
@if (Entries.Any(e => e.IsDeleted))
{
<div class="form-check form-switch history-toggle">
<input id="show-deleted" class="form-check-input" type="checkbox" role="switch" @bind="showDeleted" />
<label class="form-check-label" for="show-deleted">Gelöschte Buchungen anzeigen (@Entries.Count(e => e.IsDeleted))</label>
</div>
}
<div class="table-responsive entry-list">
<table class="table table-hover table-sm align-middle">
<thead class="table-light">
<tr>
<th style="width: 100px;">LfdNr</th>
<th style="width: 120px;">Datum</th>
<th>Bezeichnung</th>
<th style="width: 140px;" class="text-end">Betrag</th>
<th style="width: 11rem;">Aktionen</th>
</tr>
</thead>
<tbody>
@foreach (var entry in VisibleEntries)
{
<EntryRow @key="entry.Id" Highlighted="@(entry.Id == HighlightedEntryId)" Entry="entry" OnDelete="OnDeleteEntry" OnRestore="OnRestoreEntry" OnEdit="OnEditEntry" />
}
</tbody>
</table>
</div>
@if (!VisibleEntries.Any())
{
<div class="text-center py-3 text-muted">@(string.IsNullOrWhiteSpace(searchText) ? EmptyMessage : "Keine Treffer. Filter zurücksetzen zeigt wieder die Buchungen des gewählten Zeitraums.")</div>
}