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 @model MoneyMap.Pages.TransactionsModel
@{ @{
ViewData["Title"] = "Transactions"; ViewData["Title"] = "Transactions";
@@ -150,22 +150,21 @@
<th style="width: 110px;" class="text-end">Amount</th> <th style="width: 110px;" class="text-end">Amount</th>
<th style="width: 160px;">Category</th> <th style="width: 160px;">Category</th>
<th style="width: 140px;">Payment/Account</th> <th style="width: 140px;">Payment/Account</th>
<th style="width: 120px;">Actions</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
@foreach (var t in Model.Transactions) @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 class="small text-muted">#@t.Id</td>
<td>@t.Date.ToString("yyyy-MM-dd")</td> <td>@t.Date.ToString("yyyy-MM-dd")</td>
<td> <td>
<div class="d-flex align-items-center gap-2"> <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) @if (t.ReceiptCount > 0)
{ {
<span class="badge bg-success" title="@t.ReceiptCount receipt(s) attached"> <span class="badge bg-success" title="@t.ReceiptCount receipt(s) attached">
📄 @t.ReceiptCount ?? @t.ReceiptCount
</span> </span>
} }
@if (!string.IsNullOrWhiteSpace(t.Notes)) @if (!string.IsNullOrWhiteSpace(t.Notes))
@@ -174,7 +173,7 @@
title="@t.Notes" title="@t.Notes"
data-bs-toggle="tooltip" data-bs-toggle="tooltip"
data-bs-placement="top"> data-bs-placement="top">
📝 ??
</span> </span>
} }
</div> </div>
@@ -196,11 +195,7 @@
<td class="small"> <td class="small">
@t.CardLabel @t.CardLabel
</td> </td>
<td>
<a asp-page="/EditTransaction" asp-route-id="@t.Id" class="btn btn-sm btn-outline-primary" title="Edit">
Edit
</a>
</td>
</tr> </tr>
} }
</tbody> </tbody>