package templates
import (
"nickiel.net/recount_server/types"
"strconv"
)
templ TransactionRows(transactions *[]types.HumanLegibleTransaction) {
for i, value := range *transactions {
|
{strconv.Itoa(value.Id)} |
if value.AccountName.Valid {
{value.AccountName.String} |
} else {
{strconv.Itoa(value.Account)} |
}
{value.Date.Format("01/02/2006")} |
$ |
if (len(value.Amount) > 0 && value.Amount[0] == '-') {
{value.Amount} |
} else {
+{value.Amount} |
}
}
}
templ AccountSummaryRows(accounts *[]types.TwoIntsItem){
for _, value := range *accounts {
Account: {strconv.Itoa(value.Item2)}
if value.Item1 > 0 {
-${strconv.Itoa(value.Item1)}
} else {
+${strconv.Itoa(value.Item1)}
}
}
}
templ TransactionQuickAccessEntries(transactions *[]types.HumanLegibleTransaction) {
for _, value := range *transactions {
{strconv.Itoa(value.Id)}
if (len(value.Amount) > 0 && value.Amount[0] == '-') {
{value.Amount}
} else {
+{value.Amount}
}
{value.AccountName.String}
Description
}
}
templ QuickAccessPane() {
}