feat(transaction): #66 display account selection properly
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 4m53s
Some checks failed
Build Docker Image / Build-Docker-Image (push) Failing after 4m53s
This commit is contained in:
11
input.css
11
input.css
@@ -24,17 +24,6 @@ input:focus {
|
||||
--font-shippori: "Shippori Mincho", sans-serif;
|
||||
}
|
||||
|
||||
select,
|
||||
::picker(select) {
|
||||
appearance: none;
|
||||
}
|
||||
option {
|
||||
appearance: none;
|
||||
}
|
||||
::picker(select) {
|
||||
border: none;
|
||||
}
|
||||
|
||||
/* Button */
|
||||
.button {
|
||||
transition: all 150ms linear;
|
||||
|
||||
@@ -33,7 +33,7 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
||||
note string
|
||||
// accountId string
|
||||
// treasureChestId string
|
||||
value int64
|
||||
value string
|
||||
|
||||
id string
|
||||
cancelUrl string
|
||||
@@ -43,7 +43,7 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
||||
note = ""
|
||||
// accountId = ""
|
||||
// treasureChestId = ""
|
||||
value = 0
|
||||
value = "0.00"
|
||||
|
||||
id = "new"
|
||||
cancelUrl = "/empty"
|
||||
@@ -52,7 +52,7 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
||||
note = transaction.Note
|
||||
// accountId = transaction.AccountId.String()
|
||||
// treasureChestId = transaction.TreasureChestId.String()
|
||||
value = transaction.Value
|
||||
value = displayBalance(transaction.Value)
|
||||
|
||||
id = transaction.Id.String()
|
||||
cancelUrl = "/transaction/" + id
|
||||
@@ -100,20 +100,19 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
||||
}
|
||||
</select>
|
||||
<label for="treasure-chest-id" class="text-sm text-gray-500">Treasure Chest</label>
|
||||
<!-- <select -->
|
||||
<!-- name="treasure-chest-id" -->
|
||||
<!-- class="bg-white input" -->
|
||||
<!-- > -->
|
||||
<select
|
||||
name="treasure-chest-id"
|
||||
class="bg-white input"
|
||||
>
|
||||
<button>
|
||||
<selectedcontent></selectedcontent>
|
||||
</button>
|
||||
<option value="">-</option>
|
||||
for _, treasureChest := range treasureChests {
|
||||
<option value={ treasureChest.Id.String() } class="text-4xl p-20 hover:text-8xl">{ treasureChest.Name }</option>
|
||||
<!-- <option value={ treasureChest.Id.String() } class={ calculateTreasureChestClass(treasureChest) }>{ treasureChest.Name }</option> -->
|
||||
<option value={ treasureChest.Id.String() }>
|
||||
if treasureChest.ParentId != uuid.Nil {
|
||||
{ treasureChest.Name }
|
||||
} else {
|
||||
{ treasureChest.Name }
|
||||
}
|
||||
</option>
|
||||
}
|
||||
</select>
|
||||
</div>
|
||||
@@ -172,12 +171,5 @@ templ TransactionItem(transaction *types.Transaction) {
|
||||
func displayBalance(balance int64) string {
|
||||
|
||||
euros := float64(balance) / 100
|
||||
return fmt.Sprintf("%.2f €", euros)
|
||||
}
|
||||
|
||||
func calculateTreasureChestClass(treasureChest *types.TreasureChest) string {
|
||||
if treasureChest.ParentId == uuid.Nil {
|
||||
return "font-bold"
|
||||
}
|
||||
return "ml-4"
|
||||
return fmt.Sprintf("%.2f", euros)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user