feat: add direct link from account and treasurechest to the related transactions
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 4m55s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 5m16s

This commit was merged in pull request #113.
This commit is contained in:
2025-05-19 13:14:22 +02:00
parent 2e9d1e4a8d
commit 8b67cfccfa
2 changed files with 20 additions and 2 deletions

View File

@@ -85,6 +85,16 @@ templ AccountItem(account *types.Account) {
} else {
<p class="mr-20 text-green-700">{ displayBalance(account.CurrentBalance) }</p>
}
<a
href={ templ.URL("/transaction?account-id=" + account.Id.String()) }
class="button button-neglect px-1 flex items-center gap-2"
title="View transactions"
>
@svg.Eye()
<span>
View
</span>
</a>
<button
hx-get={ "/account/" + account.Id.String() + "?edit=true" }
hx-target="closest #account"

View File

@@ -1,10 +1,8 @@
package treasurechest
import "fmt"
import "spend-sparrow/template/svg"
import "spend-sparrow/types"
import "github.com/google/uuid"
templ TreasureChest(treasureChests []*types.TreasureChest) {
@@ -109,6 +107,16 @@ templ TreasureChestItem(treasureChest *types.TreasureChest) {
} else {
<p class="mr-20 text-green-700">{ displayBalance(treasureChest.CurrentBalance) }</p>
}
<a
href={ templ.URL("/transaction?treasure-chest-id=" + treasureChest.Id.String()) }
class="button button-neglect px-1 flex items-center gap-2"
title="View transactions"
>
@svg.Eye()
<span>
View
</span>
</a>
<button
hx-get={ "/treasurechest/" + treasureChest.Id.String() + "?edit=true" }
hx-target="closest #treasurechest"