Recount-Server/web/templates/new_transaction_pane.templ

117 lines
5.1 KiB
Text
Raw Permalink Normal View History

2024-02-10 08:51:27 -08:00
package templates
2024-02-10 10:52:09 -08:00
import "nickiel.net/recount_server/types"
2024-02-17 14:50:58 -08:00
import "strconv"
2024-02-10 08:51:27 -08:00
2024-02-10 10:52:09 -08:00
2024-02-27 17:35:33 -08:00
templ NewTransactionPane(entry_types *[]types.QuickTransactionType, acnts *[]types.Account, buckets *[]types.Bucket) {
2024-02-27 18:38:00 -08:00
<template id="breakdown-template-row">
<tr>
2024-02-27 17:35:33 -08:00
<td></td>
<td class="my-2">
<select class="ms-2 select border" id="acnt-entry-selection">
for _, value := range *buckets {
<option value={strconv.Itoa(value.Id)}>{value.DisplayCode.String} | {value.DisplayName.String}</option>
}
</select>
</td>
<td><input type="text" /></td>
<td><input type="number" step="any" /></td>
2024-02-27 18:38:00 -08:00
</tr>
</template>
2024-02-27 19:00:39 -08:00
<div id="new-transaction-pane" style="opacity: 0;" class="cr-all c-base d-flex-col" data-rcnt-taxrate="0.095">
2024-03-03 20:21:25 -08:00
<form method="POST" id="new-transaction-form">
<div class="my-2 d-flex">
<h2 class="ms-5">New Transaction</h2>
<button class="ms-auto me-4 my-auto exit-btn" id="close-transaction-pane">
<i class="my-auto" data-feather="x"></i>
2024-02-10 10:52:09 -08:00
</button>
2024-02-27 17:35:33 -08:00
</div>
2024-03-03 20:21:25 -08:00
<div class="d-flex">
<div class="d-flex ms-5" style="overflow-x: scroll; width: 90%;">
for _, value := range *entry_types {
<button class="borderless-btn btn-sm mx-3">
{value.DisplayName}
</button>
}
2024-02-17 20:01:29 -08:00
</div>
2024-03-03 20:21:25 -08:00
<div class="d-flex" style="width:10%">
<button type="submit" class="btn-sm my-auto ms-auto me-4 d-flex invert c-green">
<i class="my-2" data-feather="save"></i>
<span class="my-auto ms-2">Save</span>
</button>
2024-02-17 20:01:29 -08:00
</div>
2024-03-03 20:21:25 -08:00
</div>
<div class="c-mantle cr-all m-5 container" style="height: 85%;">
<div class="row mt-5">
<div class="p-5 mx-auto">
<label for="acnt-entry-selection" id="acnt-entry-label">
Account:
</label>
<select class="ms-2 select border" id="acnt-entry-selection">
for _, value := range *acnts {
<option value={strconv.Itoa(value.Id)}>{value.DisplayName.String}</option>
}
</select>
</div>
<div class="p-5 mx-auto" style="height: fit-content;">
<label>
Date:
<input class="input" id="date-entry" type="date" />
</label>
</div>
<div class="p-5 mx-auto" style="height: fit-content;">
<label>
Amount:
<input class="input" id="amount-entry" type="number" step="any" />
</label>
</div>
2024-02-27 17:35:33 -08:00
2024-03-03 20:21:25 -08:00
<div class="d-flex p-5 mx-auto">
<span class="my-auto">Tag: </span>
<label class="input-sizer">
<input
size="4"
class="input"
id="trans-tab-entry"
type="text"
/>
<span class="d-flex"> <i class="my-auto" style="transform: scale(-1,1);" data-feather="tag"></i> </span>
</label>
</div>
2024-02-17 20:01:29 -08:00
</div>
2024-03-03 20:21:25 -08:00
<div class="row">
<div class="ms-5 d-flex">
<h2 class="my-3">Breakdown</h2>
<button type="button" class="btn-sm ms-5 my-auto c-green invert" id="new-breakdown-btn">
<i class="" data-feather="plus"></i>
<span class="my-auto pe-2">New</span>
</button>
<button type="button" class="btn-sm ms-5 my-auto c-green invert" id="tax-breakdown-btn">
<i class="" data-feather="plus"></i>
<span class="my-auto pe-2">Tax</span>
</button>
</div>
2024-02-17 20:01:29 -08:00
</div>
2024-03-03 20:21:25 -08:00
<div class="row" style="flex-grow: 1">
<table class="table table-striped cr-all" style="width: 100%; border: solid 1px black;">
<thead>
<tr>
<td></td>
<td class="py-2">Bucket</td>
<td>Description</td>
<td>Amount</td>
</tr>
</thead>
<tbody id="breakdown-tbody">
2024-02-17 20:01:29 -08:00
2024-03-03 20:21:25 -08:00
</tbody>
</table>
</div>
2024-02-17 14:50:58 -08:00
</div>
2024-03-03 20:21:25 -08:00
</form>
2024-02-10 08:51:27 -08:00
</div>
2024-02-10 10:52:09 -08:00
2024-02-10 08:51:27 -08:00
}