feat(transaction): #108 display "party" and "description" in list #110

Merged
tim merged 1 commits from 108-enhance-transaction into prod 2025-05-18 16:52:34 +00:00
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" }