feat(transaction): #108 display "party" and "description" in list
This commit was merged in pull request #110.
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
}
|
||||
</p>
|
||||
<p class="text-sm text-gray-500">
|
||||
if transaction.Description != "" {
|
||||
{ transaction.Description }
|
||||
} else {
|
||||
|
||||
}
|
||||
</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" }
|
||||
|
||||
Reference in New Issue
Block a user