Wrap filter buttons with <noscript>

Since forms are already submitted on change, Oriol does not like the
idea of having a useless button around breaking the form grid.
This commit is contained in:
jordi fita mas 2023-05-23 14:34:46 +02:00
parent e974406870
commit 9096cfe4f2
5 changed files with 19 additions and 7 deletions

View File

@ -29,7 +29,9 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }}
{{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
<noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form>
</div>
<table>
@ -46,7 +48,8 @@
{{ with .Contacts }}
{{- range $contact := . }}
<tr>
<td><a href="{{ companyURI "/contacts/"}}{{ .Slug }}" data-hx-target="main" data-hx-boost="true">{{ .Name }}</a></td>
<td><a href="{{ companyURI "/contacts/"}}{{ .Slug }}" data-hx-target="main"
data-hx-boost="true">{{ .Name }}</a></td>
<td><a href="mailto:{{ .Email }}">{{ .Email }}</a></td>
<td><a href="tel:{{ .Phone }}">{{ .Phone }}</a></td>
<td

View File

@ -19,7 +19,9 @@
{{ with .Filters }}
{{ template "radio-field" .Period }}
{{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
<noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form>
</div>
<dl id="income-statement">

View File

@ -31,7 +31,9 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }}
{{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
<noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form>
</div>
<table>

View File

@ -37,7 +37,9 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }}
{{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
<noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form>
</div>
<table class="no-padding">

View File

@ -29,7 +29,9 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }}
{{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
<noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form>
</div>
<table>
@ -45,7 +47,8 @@
{{ with .Products }}
{{- range $product := . }}
<tr>
<td><a href="{{ companyURI "/products/"}}{{ .Slug }}" data-hx-target="main" data-hx-boost="true">{{ .Name }}</a></td>
<td><a href="{{ companyURI "/products/"}}{{ .Slug }}" data-hx-target="main"
data-hx-boost="true">{{ .Name }}</a></td>
<td
data-hx-get="{{companyURI "/products/"}}{{ .Slug }}/tags/edit"
data-hx-target="this"