Compare commits

..

4 Commits

Author SHA1 Message Date
jordi fita mas d2a06dd1c0 Add class=filters to filters forms 2023-05-23 14:50:46 +02:00
jordi fita mas 9096cfe4f2 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.
2023-05-23 14:34:46 +02:00
jordi fita mas e974406870 Remove the “all” columns from products and contacts
That column was supposed to have a checkbox for batch operations, but
we do not have any operation that would like to perform to many products
or contacts at the same time.  For now, at least.
2023-05-23 14:21:04 +02:00
jordi fita mas 6c7762057c Change “Edit Invoice” button to just “Save” 2023-05-23 14:18:26 +02:00
8 changed files with 74 additions and 62 deletions

View File

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: numerus\n" "Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2023-05-22 11:12+0200\n" "POT-Creation-Date: 2023-05-23 14:16+0200\n"
"PO-Revision-Date: 2023-01-18 17:08+0100\n" "PO-Revision-Date: 2023-01-18 17:08+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n" "Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Catalan <ca@dodds.net>\n" "Language-Team: Catalan <ca@dodds.net>\n"
@ -49,25 +49,24 @@ msgid "New Invoice"
msgstr "Nova factura" msgstr "Nova factura"
#: web/template/invoices/products.gohtml:48 #: web/template/invoices/products.gohtml:48
#: web/template/products/index.gohtml:38
msgctxt "product" msgctxt "product"
msgid "All" msgid "All"
msgstr "Tots" msgstr "Tots"
#: web/template/invoices/products.gohtml:49 #: web/template/invoices/products.gohtml:49
#: web/template/products/index.gohtml:39 #: web/template/products/index.gohtml:38
msgctxt "title" msgctxt "title"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: web/template/invoices/products.gohtml:50 #: web/template/invoices/products.gohtml:50
#: web/template/invoices/view.gohtml:62 web/template/products/index.gohtml:41 #: web/template/invoices/view.gohtml:62 web/template/products/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Price" msgid "Price"
msgstr "Preu" msgstr "Preu"
#: web/template/invoices/products.gohtml:64 #: web/template/invoices/products.gohtml:64
#: web/template/products/index.gohtml:81 #: web/template/products/index.gohtml:79
msgid "No products added yet." msgid "No products added yet."
msgstr "No hi ha cap producte." msgstr "No hi ha cap producte."
@ -126,7 +125,7 @@ msgctxt "title"
msgid "Invoice Num." msgid "Invoice Num."
msgstr "Núm. factura" msgstr "Núm. factura"
#: web/template/invoices/index.gohtml:49 web/template/contacts/index.gohtml:39 #: web/template/invoices/index.gohtml:49 web/template/contacts/index.gohtml:38
msgctxt "title" msgctxt "title"
msgid "Customer" msgid "Customer"
msgstr "Client" msgstr "Client"
@ -136,8 +135,8 @@ msgctxt "title"
msgid "Status" msgid "Status"
msgstr "Estat" msgstr "Estat"
#: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:42 #: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:41
#: web/template/expenses/index.gohtml:44 web/template/products/index.gohtml:40 #: web/template/expenses/index.gohtml:44 web/template/products/index.gohtml:39
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
@ -152,8 +151,8 @@ msgctxt "title"
msgid "Download" msgid "Download"
msgstr "Descàrrega" msgstr "Descàrrega"
#: web/template/invoices/index.gohtml:54 web/template/contacts/index.gohtml:43 #: web/template/invoices/index.gohtml:54 web/template/contacts/index.gohtml:42
#: web/template/expenses/index.gohtml:47 web/template/products/index.gohtml:42 #: web/template/expenses/index.gohtml:47 web/template/products/index.gohtml:41
msgctxt "title" msgctxt "title"
msgid "Actions" msgid "Actions"
msgstr "Accions" msgstr "Accions"
@ -164,8 +163,8 @@ msgid "Select invoice %v"
msgstr "Selecciona factura %v" msgstr "Selecciona factura %v"
#: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19 #: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19
#: web/template/contacts/index.gohtml:73 web/template/expenses/index.gohtml:86 #: web/template/contacts/index.gohtml:71 web/template/expenses/index.gohtml:86
#: web/template/products/index.gohtml:71 #: web/template/products/index.gohtml:69
msgctxt "action" msgctxt "action"
msgid "Edit" msgid "Edit"
msgstr "Edita" msgstr "Edita"
@ -216,8 +215,8 @@ msgstr "Edició de la factura «%s»"
#: web/template/invoices/edit.gohtml:68 #: web/template/invoices/edit.gohtml:68
msgctxt "action" msgctxt "action"
msgid "Edit invoice" msgid "Save"
msgstr "Edita factura" msgstr "Desa"
#: web/template/form.gohtml:36 #: web/template/form.gohtml:36
msgctxt "input" msgctxt "input"
@ -316,22 +315,17 @@ msgctxt "action"
msgid "New contact" msgid "New contact"
msgstr "Nou contacte" msgstr "Nou contacte"
#: web/template/contacts/index.gohtml:38 #: web/template/contacts/index.gohtml:39
msgctxt "contact"
msgid "All"
msgstr "Tots"
#: web/template/contacts/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Email" msgid "Email"
msgstr "Correu-e" msgstr "Correu-e"
#: web/template/contacts/index.gohtml:41 #: web/template/contacts/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Phone" msgid "Phone"
msgstr "Telèfon" msgstr "Telèfon"
#: web/template/contacts/index.gohtml:83 #: web/template/contacts/index.gohtml:81
msgid "No contacts added yet." msgid "No contacts added yet."
msgstr "No hi ha cap contacte." msgstr "No hi ha cap contacte."
@ -1031,6 +1025,14 @@ msgstr "No podeu deixar el codi postal en blanc."
msgid "This value is not a valid postal code." msgid "This value is not a valid postal code."
msgstr "Aquest valor no és un codi postal vàlid." msgstr "Aquest valor no és un codi postal vàlid."
#~ msgctxt "action"
#~ msgid "Edit invoice"
#~ msgstr "Edita factura"
#~ msgctxt "contact"
#~ msgid "All"
#~ msgstr "Tots"
#~ msgid "Product ID can not be empty." #~ msgid "Product ID can not be empty."
#~ msgstr "No podeu deixar lidentificador del producte en blanc." #~ msgstr "No podeu deixar lidentificador del producte en blanc."

View File

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: numerus\n" "Project-Id-Version: numerus\n"
"Report-Msgid-Bugs-To: jordi@tandem.blog\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n"
"POT-Creation-Date: 2023-05-22 11:12+0200\n" "POT-Creation-Date: 2023-05-23 14:16+0200\n"
"PO-Revision-Date: 2023-01-18 17:45+0100\n" "PO-Revision-Date: 2023-01-18 17:45+0100\n"
"Last-Translator: jordi fita mas <jordi@tandem.blog>\n" "Last-Translator: jordi fita mas <jordi@tandem.blog>\n"
"Language-Team: Spanish <es@tp.org.es>\n" "Language-Team: Spanish <es@tp.org.es>\n"
@ -49,25 +49,24 @@ msgid "New Invoice"
msgstr "Nueva factura" msgstr "Nueva factura"
#: web/template/invoices/products.gohtml:48 #: web/template/invoices/products.gohtml:48
#: web/template/products/index.gohtml:38
msgctxt "product" msgctxt "product"
msgid "All" msgid "All"
msgstr "Todos" msgstr "Todos"
#: web/template/invoices/products.gohtml:49 #: web/template/invoices/products.gohtml:49
#: web/template/products/index.gohtml:39 #: web/template/products/index.gohtml:38
msgctxt "title" msgctxt "title"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
#: web/template/invoices/products.gohtml:50 #: web/template/invoices/products.gohtml:50
#: web/template/invoices/view.gohtml:62 web/template/products/index.gohtml:41 #: web/template/invoices/view.gohtml:62 web/template/products/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Price" msgid "Price"
msgstr "Precio" msgstr "Precio"
#: web/template/invoices/products.gohtml:64 #: web/template/invoices/products.gohtml:64
#: web/template/products/index.gohtml:81 #: web/template/products/index.gohtml:79
msgid "No products added yet." msgid "No products added yet."
msgstr "No hay productos." msgstr "No hay productos."
@ -126,7 +125,7 @@ msgctxt "title"
msgid "Invoice Num." msgid "Invoice Num."
msgstr "Nº factura" msgstr "Nº factura"
#: web/template/invoices/index.gohtml:49 web/template/contacts/index.gohtml:39 #: web/template/invoices/index.gohtml:49 web/template/contacts/index.gohtml:38
msgctxt "title" msgctxt "title"
msgid "Customer" msgid "Customer"
msgstr "Cliente" msgstr "Cliente"
@ -136,8 +135,8 @@ msgctxt "title"
msgid "Status" msgid "Status"
msgstr "Estado" msgstr "Estado"
#: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:42 #: web/template/invoices/index.gohtml:51 web/template/contacts/index.gohtml:41
#: web/template/expenses/index.gohtml:44 web/template/products/index.gohtml:40 #: web/template/expenses/index.gohtml:44 web/template/products/index.gohtml:39
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
@ -152,8 +151,8 @@ msgctxt "title"
msgid "Download" msgid "Download"
msgstr "Descargar" msgstr "Descargar"
#: web/template/invoices/index.gohtml:54 web/template/contacts/index.gohtml:43 #: web/template/invoices/index.gohtml:54 web/template/contacts/index.gohtml:42
#: web/template/expenses/index.gohtml:47 web/template/products/index.gohtml:42 #: web/template/expenses/index.gohtml:47 web/template/products/index.gohtml:41
msgctxt "title" msgctxt "title"
msgid "Actions" msgid "Actions"
msgstr "Acciones" msgstr "Acciones"
@ -164,8 +163,8 @@ msgid "Select invoice %v"
msgstr "Seleccionar factura %v" msgstr "Seleccionar factura %v"
#: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19 #: web/template/invoices/index.gohtml:116 web/template/invoices/view.gohtml:19
#: web/template/contacts/index.gohtml:73 web/template/expenses/index.gohtml:86 #: web/template/contacts/index.gohtml:71 web/template/expenses/index.gohtml:86
#: web/template/products/index.gohtml:71 #: web/template/products/index.gohtml:69
msgctxt "action" msgctxt "action"
msgid "Edit" msgid "Edit"
msgstr "Editar" msgstr "Editar"
@ -216,8 +215,8 @@ msgstr "Edición de la factura «%s»"
#: web/template/invoices/edit.gohtml:68 #: web/template/invoices/edit.gohtml:68
msgctxt "action" msgctxt "action"
msgid "Edit invoice" msgid "Save"
msgstr "Editar factura" msgstr "Guardad"
#: web/template/form.gohtml:36 #: web/template/form.gohtml:36
msgctxt "input" msgctxt "input"
@ -316,22 +315,17 @@ msgctxt "action"
msgid "New contact" msgid "New contact"
msgstr "Nuevo contacto" msgstr "Nuevo contacto"
#: web/template/contacts/index.gohtml:38 #: web/template/contacts/index.gohtml:39
msgctxt "contact"
msgid "All"
msgstr "Todos"
#: web/template/contacts/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Email" msgid "Email"
msgstr "Correo-e" msgstr "Correo-e"
#: web/template/contacts/index.gohtml:41 #: web/template/contacts/index.gohtml:40
msgctxt "title" msgctxt "title"
msgid "Phone" msgid "Phone"
msgstr "Teléfono" msgstr "Teléfono"
#: web/template/contacts/index.gohtml:83 #: web/template/contacts/index.gohtml:81
msgid "No contacts added yet." msgid "No contacts added yet."
msgstr "No hay contactos." msgstr "No hay contactos."
@ -1031,6 +1025,14 @@ msgstr "No podéis dejar el código postal en blanco."
msgid "This value is not a valid postal code." msgid "This value is not a valid postal code."
msgstr "Este valor no es un código postal válido válido." msgstr "Este valor no es un código postal válido válido."
#~ msgctxt "action"
#~ msgid "Edit invoice"
#~ msgstr "Editar factura"
#~ msgctxt "contact"
#~ msgid "All"
#~ msgstr "Todos"
#~ msgid "Product ID can not be empty." #~ msgid "Product ID can not be empty."
#~ msgstr "No podéis dejar el identificador de producto en blanco." #~ msgstr "No podéis dejar el identificador de producto en blanco."

View File

@ -19,7 +19,7 @@
{{ define "content" }} {{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.ContactsIndexPage*/ -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.ContactsIndexPage*/ -}}
<div aria-label="{{( pgettext "Filters" "title" )}}"> <div aria-label="{{( pgettext "Filters" "title" )}}">
<form method="GET" action="{{ companyURI "/contacts"}}" <form class="filters" method="GET" action="{{ companyURI "/contacts"}}"
data-hx-target="main" data-hx-target="main"
data-hx-boost="true" data-hx-boost="true"
data-hx-trigger="change,search,submit" data-hx-trigger="change,search,submit"
@ -29,13 +29,14 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }} {{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }} {{ template "toggle-field" .TagsCondition }}
{{ end }} {{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button> <noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form> </form>
</div> </div>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>{{( pgettext "All" "contact" )}}</th>
<th>{{( pgettext "Customer" "title" )}}</th> <th>{{( pgettext "Customer" "title" )}}</th>
<th>{{( pgettext "Email" "title" )}}</th> <th>{{( pgettext "Email" "title" )}}</th>
<th>{{( pgettext "Phone" "title" )}}</th> <th>{{( pgettext "Phone" "title" )}}</th>
@ -47,8 +48,8 @@
{{ with .Contacts }} {{ with .Contacts }}
{{- range $contact := . }} {{- range $contact := . }}
<tr> <tr>
<td></td> <td><a href="{{ companyURI "/contacts/"}}{{ .Slug }}" data-hx-target="main"
<td><a href="{{ companyURI "/contacts/"}}{{ .Slug }}" data-hx-target="main" data-hx-boost="true">{{ .Name }}</a></td> data-hx-boost="true">{{ .Name }}</a></td>
<td><a href="mailto:{{ .Email }}">{{ .Email }}</a></td> <td><a href="mailto:{{ .Email }}">{{ .Email }}</a></td>
<td><a href="tel:{{ .Phone }}">{{ .Phone }}</a></td> <td><a href="tel:{{ .Phone }}">{{ .Phone }}</a></td>
<td <td
@ -80,7 +81,7 @@
{{- end }} {{- end }}
{{ else }} {{ else }}
<tr> <tr>
<td colspan="6">{{( gettext "No contacts added yet." )}}</td> <td colspan="5">{{( gettext "No contacts added yet." )}}</td>
</tr> </tr>
{{ end }} {{ end }}
</tbody> </tbody>

View File

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

View File

@ -20,7 +20,7 @@
{{ define "content" }} {{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.expensesIndexPage*/ -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.expensesIndexPage*/ -}}
<div aria-label="{{( pgettext "Filters" "title" )}}"> <div aria-label="{{( pgettext "Filters" "title" )}}">
<form method="GET" action="{{ companyURI "/expenses"}}" <form class="filters" method="GET" action="{{ companyURI "/expenses"}}"
data-hx-target="main" data-hx-boost="true" data-hx-trigger="change,search,submit" data-hx-target="main" data-hx-boost="true" data-hx-trigger="change,search,submit"
> >
{{ with .Filters }} {{ with .Filters }}
@ -31,7 +31,9 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }} {{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }} {{ template "toggle-field" .TagsCondition }}
{{ end }} {{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button> <noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form> </form>
</div> </div>
<table> <table>

View File

@ -65,7 +65,7 @@
name="action" value="update" name="action" value="update"
type="submit">{{( pgettext "Update" "action" )}}</button> type="submit">{{( pgettext "Update" "action" )}}</button>
<button class="primary" name="_method" value="PUT" <button class="primary" name="_method" value="PUT"
type="submit">{{( pgettext "Edit invoice" "action" )}}</button> type="submit">{{( pgettext "Save" "action" )}}</button>
</fieldset> </fieldset>
</form> </form>

View File

@ -26,7 +26,7 @@
{{ define "content" }} {{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.InvoicesIndexPage*/ -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.InvoicesIndexPage*/ -}}
<div aria-label="{{( pgettext "Filters" "title" )}}"> <div aria-label="{{( pgettext "Filters" "title" )}}">
<form method="GET" action="{{ companyURI "/invoices"}}" data-hx-target="main" data-hx-boost="true" <form class="filters" method="GET" action="{{ companyURI "/invoices"}}" data-hx-target="main" data-hx-boost="true"
data-hx-trigger="change,search,submit"> data-hx-trigger="change,search,submit">
{{ with .Filters }} {{ with .Filters }}
{{ template "select-field" .Customer }} {{ template "select-field" .Customer }}
@ -37,7 +37,9 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }} {{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }} {{ template "toggle-field" .TagsCondition }}
{{ end }} {{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button> <noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form> </form>
</div> </div>
<table class="no-padding"> <table class="no-padding">

View File

@ -19,7 +19,7 @@
{{ define "content" }} {{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.productsIndexPage*/ -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.productsIndexPage*/ -}}
<div aria-label="{{( pgettext "Filters" "title" )}}"> <div aria-label="{{( pgettext "Filters" "title" )}}">
<form method="GET" action="{{ companyURI "/products"}}" <form class="filters" method="GET" action="{{ companyURI "/products"}}"
data-hx-target="main" data-hx-target="main"
data-hx-boost="true" data-hx-boost="true"
data-hx-trigger="change,search,submit" data-hx-trigger="change,search,submit"
@ -29,13 +29,14 @@
{{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }} {{ template "tags-field" .Tags | addTagsAttr (print `data-conditions="` .TagsCondition.Name `-field"`) }}
{{ template "toggle-field" .TagsCondition }} {{ template "toggle-field" .TagsCondition }}
{{ end }} {{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button> <noscript>
<button type="submit">{{( pgettext "Filter" "action" )}}</button>
</noscript>
</form> </form>
</div> </div>
<table> <table>
<thead> <thead>
<tr> <tr>
<th>{{( pgettext "All" "product" )}}</th>
<th>{{( pgettext "Name" "title" )}}</th> <th>{{( pgettext "Name" "title" )}}</th>
<th>{{( pgettext "Tags" "title" )}}</th> <th>{{( pgettext "Tags" "title" )}}</th>
<th>{{( pgettext "Price" "title" )}}</th> <th>{{( pgettext "Price" "title" )}}</th>
@ -46,8 +47,8 @@
{{ with .Products }} {{ with .Products }}
{{- range $product := . }} {{- range $product := . }}
<tr> <tr>
<td></td> <td><a href="{{ companyURI "/products/"}}{{ .Slug }}" data-hx-target="main"
<td><a href="{{ companyURI "/products/"}}{{ .Slug }}" data-hx-target="main" data-hx-boost="true">{{ .Name }}</a></td> data-hx-boost="true">{{ .Name }}</a></td>
<td <td
data-hx-get="{{companyURI "/products/"}}{{ .Slug }}/tags/edit" data-hx-get="{{companyURI "/products/"}}{{ .Slug }}/tags/edit"
data-hx-target="this" data-hx-target="this"
@ -78,7 +79,7 @@
{{- end }} {{- end }}
{{ else }} {{ else }}
<tr> <tr>
<td colspan="5">{{( gettext "No products added yet." )}}</td> <td colspan="4">{{( gettext "No products added yet." )}}</td>
</tr> </tr>
{{ end }} {{ end }}
</tbody> </tbody>