Transactions: make rows clickable to open Edit; remove Edit button; keep name as link

This commit is contained in:
AJ
2025-10-19 00:47:44 -04:00
parent ed0d82a549
commit 134a1b8c9f

View File

@@ -1,4 +1,4 @@
@page
@page
@model MoneyMap.Pages.TransactionsModel
@{
ViewData["Title"] = "Transactions";
@@ -150,22 +150,21 @@
<th style="width: 110px;" class="text-end">Amount</th>
<th style="width: 160px;">Category</th>
<th style="width: 140px;">Payment/Account</th>
<th style="width: 120px;">Actions</th>
</tr>
</thead>
<tbody>
@foreach (var t in Model.Transactions)
{
<tr>
<tr style="cursor: pointer;" title="Open details" onclick="window.location.href='@Url.Page("/EditTransaction", new { id = t.Id })'">
<td class="small text-muted">#@t.Id</td>
<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">
📄 @t.ReceiptCount
?? @t.ReceiptCount
</span>
}
@if (!string.IsNullOrWhiteSpace(t.Notes))
@@ -174,7 +173,7 @@
title="@t.Notes"
data-bs-toggle="tooltip"
data-bs-placement="top">
📝
??
</span>
}
</div>
@@ -196,11 +195,7 @@
<td class="small">
@t.CardLabel
</td>
<td>
<a asp-page="/EditTransaction" asp-route-id="@t.Id" class="btn btn-sm btn-outline-primary" title="Edit">
Edit
</a>
</td>
</tr>
}
</tbody>
@@ -353,4 +348,4 @@ else
document.getElementById('endDateInput').value = formatDate(endDate);
}
</script>
}
}