Split the tax details “mega dialog” into separate pages
I needed to place the payment accounts section somewhere, and the most
logical place seemed to be that dialog, where users can set up company
parameters.
However, that dialog was already saturated with related, but ultimately
independent forms, and adding the account section would make things
even worse, specially given that we need to be able to edit those
accounts in a separate page.
We agreed to separate that dialog into tabs, which means separate pages.
When i had everything in a separated page, then i did not know how to
actually share the code for the tabs, and decided that, for now, these
“tabs” would be items from the profile menu. Same function, different
presentation.
2024-08-14 02:08:13 +00:00
|
|
|
{{ define "title" -}}
|
|
|
|
{{( pgettext "Tax Details" "title" )}}
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "breadcrumbs" -}}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.TaxDetailsPage*/ -}}
|
Remove almost all data-hx-boost attributes
Since 16e80b5ae, <body> no longer has overflow, thus no scroll. As a
consequence, htmx no longer is able to scroll up <main> when it changes
due to the default, implicit `show:true` applied to the request: is
calls <main>’s scrollIntoView, however there is nothing to scroll to.
I probably could fix it by changing the target of `show`, or even add
a `scroll` directive to all boosted links, but at this point i think it
is better no not boost links at all, as they do what i want—show the new
page from the top—with less markup, plus the browser now show a loading
animation, and it is not that slower, too.
2024-09-07 23:29:30 +00:00
|
|
|
<nav>
|
Split the tax details “mega dialog” into separate pages
I needed to place the payment accounts section somewhere, and the most
logical place seemed to be that dialog, where users can set up company
parameters.
However, that dialog was already saturated with related, but ultimately
independent forms, and adding the account section would make things
even worse, specially given that we need to be able to edit those
accounts in a separate page.
We agreed to separate that dialog into tabs, which means separate pages.
When i had everything in a separated page, then i did not know how to
actually share the code for the tabs, and decided that, for now, these
“tabs” would be items from the profile menu. Same function, different
presentation.
2024-08-14 02:08:13 +00:00
|
|
|
<p>
|
|
|
|
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
|
|
|
|
<a>{{ template "title" . }}</a>
|
|
|
|
</p>
|
|
|
|
</nav>
|
|
|
|
{{- end }}
|
|
|
|
|
|
|
|
{{ define "content" }}
|
|
|
|
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.TaxDetailsPage*/ -}}
|
|
|
|
<section data-hx-target="main" data-hx-swap="innerHTML show:false">
|
|
|
|
<h2>{{ template "title" . }}</h2>
|
|
|
|
{{ with .DetailsForm }}
|
|
|
|
<form method="POST" action="{{ companyURI "/tax-details" }}" data-hx-boost="true">
|
|
|
|
{{ csrfToken }}
|
|
|
|
{{ template "input-field" .BusinessName }}
|
|
|
|
{{ template "input-field" .VATIN }}
|
|
|
|
{{ template "input-field" .TradeName }}
|
|
|
|
{{ template "input-field" .Phone }}
|
|
|
|
{{ template "input-field" .Email }}
|
|
|
|
{{ template "input-field" .Web }}
|
|
|
|
{{ template "input-field" .Address | addInputAttr `class="width-2x"` }}
|
|
|
|
{{ template "input-field" .City }}
|
|
|
|
{{ template "input-field" .Province }}
|
|
|
|
{{ template "input-field" .PostalCode }}
|
|
|
|
{{ template "select-field" .Country | addSelectAttr `class="width-fixed"` }}
|
|
|
|
{{ template "select-field" .Currency }}
|
|
|
|
|
|
|
|
<fieldset>
|
|
|
|
<button type="submit">{{( pgettext "Save changes" "action" )}}</button>
|
|
|
|
</fieldset>
|
|
|
|
</form>
|
|
|
|
{{ end }}
|
|
|
|
</section>
|
|
|
|
{{- end }}
|