feat(transaction): #108 display "party" and "description" in list
All checks were successful
Build Docker Image / Build-Docker-Image (push) Successful in 4m25s
Build and Push Docker Image / Build-And-Push-Docker-Image (push) Successful in 4m26s

This commit was merged in pull request #110.
This commit is contained in:
2025-05-18 18:48:01 +02:00
parent 25e748c12b
commit e8a1c55424
2 changed files with 20 additions and 4 deletions

View File

@@ -6,7 +6,7 @@ import (
)
var (
safeInputRegex = regexp.MustCompile(`^[a-zA-Z0-9ÄÖÜäöüß -]+$`)
safeInputRegex = regexp.MustCompile(`^[a-zA-Z0-9ÄÖÜäöüß, -]+$`)
)
func validateString(value string, fieldName string) error {

View File

@@ -193,7 +193,7 @@ templ TransactionItem(transaction *types.Transaction, accounts, treasureChests m
}}
<div
id="transaction"
class={ "mt-4 border-1 grid grid-cols-[auto_auto_1fr_1fr_auto_auto_auto] gap-4 items-center text-xl border-gray-300 w-full p-4 rounded-lg " + background }
class={ "mt-4 border-1 grid grid-cols-[auto_auto_1fr_1fr_auto_auto_auto_auto] gap-4 items-center text-xl border-gray-300 w-full p-4 rounded-lg " + background }
if transaction.Error != nil {
title={ *transaction.Error }
}
@@ -220,10 +220,26 @@ templ TransactionItem(transaction *types.Transaction, accounts, treasureChests m
}
</p>
</div>
<div>
<p class="text-sm text-gray-500">
if transaction.Party != "" {
{ transaction.Party }
} else {
&nbsp;
}
</p>
<p class="text-sm text-gray-500">
if transaction.Description != "" {
{ transaction.Description }
} else {
&nbsp;
}
</p>
</div>
if transaction.Value < 0 {
<p class="mr-20 text-red-700">{ displayBalance(transaction.Value)+" €" }</p>
<p class="mr-8 min-w-22 text-right text-red-700">{ displayBalance(transaction.Value)+" €" }</p>
} else {
<p class="mr-20 text-green-700">{ displayBalance(transaction.Value)+" €" }</p>
<p class="mr-8 w-22 text-right text-green-700">{ displayBalance(transaction.Value)+" €" }</p>
}
<button
hx-get={ "/transaction/" + transaction.Id.String() + "?edit=true" }