feat: keyboard shortcuts to add bill and/or deposit
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m49s
All checks were successful
Deploy / build-and-deploy (push) Successful in 1m49s
This commit is contained in:
parent
43e6f76c01
commit
aaa96b921c
1 changed files with 9 additions and 2 deletions
|
|
@ -109,6 +109,13 @@ templ spaceSpecificSidebarContent(spaceID string) {
|
|||
}
|
||||
|
||||
templ spaceAccountSidebarContent(spaceID, accountID string) {
|
||||
{{
|
||||
billURL := routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID)
|
||||
depositURL := routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID)
|
||||
shortcutScript := "on keydown[(metaKey or ctrlKey) and altKey and (code=='KeyB' or key=='b' or key=='B')] from window halt the event then set window.location.href to '" + billURL + "' end " +
|
||||
"on keydown[(metaKey or ctrlKey) and altKey and (code=='KeyE' or key=='e' or key=='E')] from window halt the event then set window.location.href to '" + depositURL + "'"
|
||||
}}
|
||||
<div hidden _={ shortcutScript }></div>
|
||||
@sidebar.Group() {
|
||||
@sidebar.GroupLabel() {
|
||||
Account
|
||||
|
|
@ -138,7 +145,7 @@ templ spaceAccountSidebarContent(spaceID, accountID string) {
|
|||
@sidebar.MenuButton(sidebar.MenuButtonProps{
|
||||
Href: routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID),
|
||||
IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.bills.create", "spaceID", spaceID, "accountID", accountID),
|
||||
Tooltip: "Pay Bills",
|
||||
Tooltip: "Pay Bills (⌘/Ctrl + Alt + B)",
|
||||
}) {
|
||||
@icon.HandCoins()
|
||||
<span>Pay Bills</span>
|
||||
|
|
@ -148,7 +155,7 @@ templ spaceAccountSidebarContent(spaceID, accountID string) {
|
|||
@sidebar.MenuButton(sidebar.MenuButtonProps{
|
||||
Href: routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID),
|
||||
IsActive: ctxkeys.URLPath(ctx) == routeurl.URL("page.app.spaces.space.accounts.account.deposits.create", "spaceID", spaceID, "accountID", accountID),
|
||||
Tooltip: "Deposit Funds",
|
||||
Tooltip: "Deposit Funds (⌘/Ctrl + Alt + E)",
|
||||
}) {
|
||||
@icon.BanknoteArrowDown()
|
||||
<span>Deposit Funds</span>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue