Dashboard: make recent transactions clickable and add Open action; include Id and ReceiptCount in recent data
Co-authored-by:Codex-CLI-Agent codex-cli@users.noreply.local
This commit is contained in:
@@ -111,16 +111,17 @@
|
||||
<th style="width: 110px;" class="text-end">Amount</th>
|
||||
<th style="width: 160px;">Category</th>
|
||||
<th style="width: 110px;">Card</th>
|
||||
<th style="width: 90px;">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach (var t in Model.Recent)
|
||||
{
|
||||
<tr>
|
||||
<tr style="cursor: pointer;" title="View details" onclick="window.location.href='@Url.Page("/EditTransaction", new { id = t.Id })'">
|
||||
<td>@t.Date.ToString("yyyy-MM-dd")</td>
|
||||
<td>
|
||||
<div class="d-flex align-items-center gap-2">
|
||||
<span>@t.Name</span>
|
||||
<a asp-page="/EditTransaction" asp-route-id="@t.Id" class="text-decoration-none text-dark">@t.Name</a>
|
||||
@if (t.ReceiptCount > 0)
|
||||
{
|
||||
<span class="badge bg-success" title="@t.ReceiptCount receipt(s) attached">
|
||||
@@ -142,6 +143,9 @@
|
||||
}
|
||||
</td>
|
||||
<td>@t.CardLabel</td>
|
||||
<td>
|
||||
<a asp-page="/EditTransaction" asp-route-id="@t.Id" class="btn btn-sm btn-outline-secondary">Open</a>
|
||||
</td>
|
||||
</tr>
|
||||
}
|
||||
</tbody>
|
||||
|
||||
@@ -50,6 +50,7 @@ namespace MoneyMap.Pages
|
||||
|
||||
public class RecentTxnRow
|
||||
{
|
||||
public long Id { get; set; }
|
||||
public DateTime Date { get; set; }
|
||||
public string Name { get; set; } = "";
|
||||
public string Memo { get; set; } = "";
|
||||
@@ -230,12 +231,14 @@ namespace MoneyMap.Pages
|
||||
.ThenByDescending(t => t.Id)
|
||||
.Select(t => new IndexModel.RecentTxnRow
|
||||
{
|
||||
Id = t.Id,
|
||||
Date = t.Date,
|
||||
Name = t.Name,
|
||||
Memo = t.Memo,
|
||||
Amount = t.Amount,
|
||||
Category = t.Category ?? "",
|
||||
CardLabel = t.PaymentMethodLabel
|
||||
CardLabel = t.PaymentMethodLabel,
|
||||
ReceiptCount = t.Receipts.Count()
|
||||
})
|
||||
.Take(count)
|
||||
.AsNoTracking()
|
||||
|
||||
Reference in New Issue
Block a user