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;
|
--font-shippori: "Shippori Mincho", sans-serif;
|
||||||
}
|
}
|
||||||
|
|
||||||
select,
|
|
||||||
::picker(select) {
|
|
||||||
appearance: none;
|
|
||||||
}
|
|
||||||
option {
|
|
||||||
appearance: none;
|
|
||||||
}
|
|
||||||
::picker(select) {
|
|
||||||
border: none;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Button */
|
/* Button */
|
||||||
.button {
|
.button {
|
||||||
transition: all 150ms linear;
|
transition: all 150ms linear;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
|||||||
note string
|
note string
|
||||||
// accountId string
|
// accountId string
|
||||||
// treasureChestId string
|
// treasureChestId string
|
||||||
value int64
|
value string
|
||||||
|
|
||||||
id string
|
id string
|
||||||
cancelUrl string
|
cancelUrl string
|
||||||
@@ -43,7 +43,7 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
|||||||
note = ""
|
note = ""
|
||||||
// accountId = ""
|
// accountId = ""
|
||||||
// treasureChestId = ""
|
// treasureChestId = ""
|
||||||
value = 0
|
value = "0.00"
|
||||||
|
|
||||||
id = "new"
|
id = "new"
|
||||||
cancelUrl = "/empty"
|
cancelUrl = "/empty"
|
||||||
@@ -52,7 +52,7 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
|||||||
note = transaction.Note
|
note = transaction.Note
|
||||||
// accountId = transaction.AccountId.String()
|
// accountId = transaction.AccountId.String()
|
||||||
// treasureChestId = transaction.TreasureChestId.String()
|
// treasureChestId = transaction.TreasureChestId.String()
|
||||||
value = transaction.Value
|
value = displayBalance(transaction.Value)
|
||||||
|
|
||||||
id = transaction.Id.String()
|
id = transaction.Id.String()
|
||||||
cancelUrl = "/transaction/" + id
|
cancelUrl = "/transaction/" + id
|
||||||
@@ -100,20 +100,19 @@ templ EditTransaction(transaction *types.Transaction, accounts []*types.Account,
|
|||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
<label for="treasure-chest-id" class="text-sm text-gray-500">Treasure Chest</label>
|
<label for="treasure-chest-id" class="text-sm text-gray-500">Treasure Chest</label>
|
||||||
<!-- <select -->
|
|
||||||
<!-- name="treasure-chest-id" -->
|
|
||||||
<!-- class="bg-white input" -->
|
|
||||||
<!-- > -->
|
|
||||||
<select
|
<select
|
||||||
name="treasure-chest-id"
|
name="treasure-chest-id"
|
||||||
|
class="bg-white input"
|
||||||
>
|
>
|
||||||
<button>
|
|
||||||
<selectedcontent></selectedcontent>
|
|
||||||
</button>
|
|
||||||
<option value="">-</option>
|
<option value="">-</option>
|
||||||
for _, treasureChest := range treasureChests {
|
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() }>
|
||||||
<!-- <option value={ treasureChest.Id.String() } class={ calculateTreasureChestClass(treasureChest) }>{ treasureChest.Name }</option> -->
|
if treasureChest.ParentId != uuid.Nil {
|
||||||
|
{ treasureChest.Name }
|
||||||
|
} else {
|
||||||
|
{ treasureChest.Name }
|
||||||
|
}
|
||||||
|
</option>
|
||||||
}
|
}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@@ -172,12 +171,5 @@ templ TransactionItem(transaction *types.Transaction) {
|
|||||||
func displayBalance(balance int64) string {
|
func displayBalance(balance int64) string {
|
||||||
|
|
||||||
euros := float64(balance) / 100
|
euros := float64(balance) / 100
|
||||||
return fmt.Sprintf("%.2f €", euros)
|
return fmt.Sprintf("%.2f", euros)
|
||||||
}
|
|
||||||
|
|
||||||
func calculateTreasureChestClass(treasureChest *types.TreasureChest) string {
|
|
||||||
if treasureChest.ParentId == uuid.Nil {
|
|
||||||
return "font-bold"
|
|
||||||
}
|
|
||||||
return "ml-4"
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user