Replace use of <select> for tags “and” and “or” with checkboxes

I realized that using a select for just two, short, options is overkill:
the select and its options use a lot more real state than the two
radios, which can have tooltips (not yet, though).

Since i am going to replace this field with a custom element that has
a toggle-like aspect, i already added the is="numerus-toggle" attribute
and use it for stying the non-JavaScript field.
This commit is contained in:
jordi fita mas 2023-04-15 04:05:59 +02:00
parent 8f7933ffe2
commit 5e01965d7e
7 changed files with 264 additions and 192 deletions

View File

@ -258,6 +258,20 @@ func (field *TagsField) String() string {
return strings.Join(field.Tags, ",") return strings.Join(field.Tags, ",")
} }
type ToggleField struct {
Name string
Label string
Selected string
FirstOption *SelectOption
SecondOption *SelectOption
Attributes []template.HTMLAttr
Errors []error
}
func (field *ToggleField) FillValue(r *http.Request) {
field.Selected = strings.TrimSpace(r.FormValue(field.Name))
}
type FormValidator struct { type FormValidator struct {
Valid bool Valid bool
} }

View File

@ -79,7 +79,7 @@ func mustCollectInvoiceEntries(ctx context.Context, conn *Conn, company *Company
maybeAppendWhere("invoice_date >= $%d", filters.FromDate.String(), nil) maybeAppendWhere("invoice_date >= $%d", filters.FromDate.String(), nil)
maybeAppendWhere("invoice_date <= $%d", filters.ToDate.String(), nil) maybeAppendWhere("invoice_date <= $%d", filters.ToDate.String(), nil)
if len(filters.Tags.Tags) > 0 { if len(filters.Tags.Tags) > 0 {
if filters.TagsCondition.String() == "and" { if filters.TagsCondition.Selected == "and" {
appendWhere("invoice.tags @> $%d", filters.Tags) appendWhere("invoice.tags @> $%d", filters.Tags)
} else { } else {
appendWhere("invoice.tags && $%d", filters.Tags) appendWhere("invoice.tags && $%d", filters.Tags)
@ -148,7 +148,7 @@ type invoiceFilterForm struct {
FromDate *InputField FromDate *InputField
ToDate *InputField ToDate *InputField
Tags *TagsField Tags *TagsField
TagsCondition *SelectField TagsCondition *ToggleField
} }
func newInvoiceFilterForm(ctx context.Context, conn *Conn, locale *Locale, company *Company) *invoiceFilterForm { func newInvoiceFilterForm(ctx context.Context, conn *Conn, locale *Locale, company *Company) *invoiceFilterForm {
@ -186,13 +186,15 @@ func newInvoiceFilterForm(ctx context.Context, conn *Conn, locale *Locale, compa
Name: "tags", Name: "tags",
Label: pgettext("input", "Tags", locale), Label: pgettext("input", "Tags", locale),
}, },
TagsCondition: &SelectField{ TagsCondition: &ToggleField{
Name: "tags_condition", Name: "tags_condition",
Label: pgettext("input", "Tags Condition", locale), Label: pgettext("input", "Tags Condition", locale),
Selected: []string{"and"}, Selected: "and",
Options: []*SelectOption{ FirstOption: &SelectOption{
{Value: "and", Label: pgettext("logical", "AND", locale)}, Value: "and", Label: pgettext("tag condition", "All", locale),
{Value: "or", Label: pgettext("logical", "OR", locale)}, },
SecondOption: &SelectOption{
Value: "or", Label: pgettext("tag condition", "Any", locale),
}, },
}, },
} }

195
po/ca.po
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-03-29 16:08+0200\n" "POT-Creation-Date: 2023-04-15 04:00+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"
@ -47,43 +47,43 @@ msgctxt "title"
msgid "New Invoice" msgid "New Invoice"
msgstr "Nova factura" msgstr "Nova factura"
#: web/template/invoices/products.gohtml:51 #: web/template/invoices/products.gohtml:49
#: web/template/products/index.gohtml:25 #: web/template/products/index.gohtml:25
msgctxt "product" msgctxt "product"
msgid "All" msgid "All"
msgstr "Tots" msgstr "Tots"
#: web/template/invoices/products.gohtml:52 #: web/template/invoices/products.gohtml:50
#: web/template/products/index.gohtml:26 #: web/template/products/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: web/template/invoices/products.gohtml:53 #: web/template/invoices/products.gohtml:51
#: web/template/invoices/view.gohtml:59 web/template/products/index.gohtml:28 #: web/template/invoices/view.gohtml:62 web/template/products/index.gohtml:28
msgctxt "title" msgctxt "title"
msgid "Price" msgid "Price"
msgstr "Preu" msgstr "Preu"
#: web/template/invoices/products.gohtml:67 #: web/template/invoices/products.gohtml:65
#: web/template/products/index.gohtml:48 #: web/template/products/index.gohtml:48
msgid "No products added yet." msgid "No products added yet."
msgstr "No hi ha cap producte." msgstr "No hi ha cap producte."
#: web/template/invoices/products.gohtml:75 web/template/invoices/new.gohtml:67 #: web/template/invoices/products.gohtml:73 web/template/invoices/new.gohtml:67
#: web/template/invoices/edit.gohtml:68 #: web/template/invoices/edit.gohtml:68
msgctxt "action" msgctxt "action"
msgid "Add products" msgid "Add products"
msgstr "Afegeix productes" msgstr "Afegeix productes"
#: web/template/invoices/new.gohtml:48 web/template/invoices/view.gohtml:64 #: web/template/invoices/new.gohtml:48 web/template/invoices/view.gohtml:67
#: web/template/invoices/edit.gohtml:49 #: web/template/invoices/edit.gohtml:49
msgctxt "title" msgctxt "title"
msgid "Subtotal" msgid "Subtotal"
msgstr "Subtotal" msgstr "Subtotal"
#: web/template/invoices/new.gohtml:58 web/template/invoices/view.gohtml:68 #: web/template/invoices/new.gohtml:58 web/template/invoices/view.gohtml:71
#: web/template/invoices/view.gohtml:108 web/template/invoices/edit.gohtml:59 #: web/template/invoices/view.gohtml:111 web/template/invoices/edit.gohtml:59
msgctxt "title" msgctxt "title"
msgid "Total" msgid "Total"
msgstr "Total" msgstr "Total"
@ -93,7 +93,7 @@ msgctxt "action"
msgid "Update" msgid "Update"
msgstr "Actualitza" msgstr "Actualitza"
#: web/template/invoices/new.gohtml:72 web/template/invoices/index.gohtml:20 #: web/template/invoices/new.gohtml:72 web/template/invoices/index.gohtml:21
msgctxt "action" msgctxt "action"
msgid "New invoice" msgid "New invoice"
msgstr "Nova factura" msgstr "Nova factura"
@ -103,102 +103,102 @@ msgctxt "action"
msgid "Download invoices" msgid "Download invoices"
msgstr "Descarrega factures" msgstr "Descarrega factures"
#: web/template/invoices/index.gohtml:38 #: web/template/invoices/index.gohtml:41
msgctxt "action" msgctxt "action"
msgid "Filter" msgid "Filter"
msgstr "Filtra" msgstr "Filtra"
#: web/template/invoices/index.gohtml:44 #: web/template/invoices/index.gohtml:47
msgctxt "invoice" msgctxt "invoice"
msgid "All" msgid "All"
msgstr "Totes" msgstr "Totes"
#: web/template/invoices/index.gohtml:45 web/template/invoices/view.gohtml:31 #: web/template/invoices/index.gohtml:48 web/template/invoices/view.gohtml:34
msgctxt "title" msgctxt "title"
msgid "Date" msgid "Date"
msgstr "Data" msgstr "Data"
#: web/template/invoices/index.gohtml:46 #: web/template/invoices/index.gohtml:49
msgctxt "title" msgctxt "title"
msgid "Invoice Num." msgid "Invoice Num."
msgstr "Núm. factura" msgstr "Núm. factura"
#: web/template/invoices/index.gohtml:47 web/template/contacts/index.gohtml:26 #: web/template/invoices/index.gohtml:50 web/template/contacts/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Customer" msgid "Customer"
msgstr "Client" msgstr "Client"
#: web/template/invoices/index.gohtml:48 #: web/template/invoices/index.gohtml:51
msgctxt "title" msgctxt "title"
msgid "Status" msgid "Status"
msgstr "Estat" msgstr "Estat"
#: web/template/invoices/index.gohtml:49 web/template/contacts/index.gohtml:29 #: web/template/invoices/index.gohtml:52 web/template/contacts/index.gohtml:29
#: web/template/products/index.gohtml:27 #: web/template/products/index.gohtml:27
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: web/template/invoices/index.gohtml:50 #: web/template/invoices/index.gohtml:53
msgctxt "title" msgctxt "title"
msgid "Amount" msgid "Amount"
msgstr "Import" msgstr "Import"
#: web/template/invoices/index.gohtml:51 #: web/template/invoices/index.gohtml:54
msgctxt "title" msgctxt "title"
msgid "Download" msgid "Download"
msgstr "Descàrrega" msgstr "Descàrrega"
#: web/template/invoices/index.gohtml:52 #: web/template/invoices/index.gohtml:55
msgctxt "title" msgctxt "title"
msgid "Actions" msgid "Actions"
msgstr "Accions" msgstr "Accions"
#: web/template/invoices/index.gohtml:59 #: web/template/invoices/index.gohtml:62
msgctxt "action" msgctxt "action"
msgid "Select invoice %v" msgid "Select invoice %v"
msgstr "Selecciona factura %v" msgstr "Selecciona factura %v"
#: web/template/invoices/index.gohtml:109 web/template/invoices/view.gohtml:16 #: web/template/invoices/index.gohtml:117 web/template/invoices/view.gohtml:19
msgctxt "action" msgctxt "action"
msgid "Edit" msgid "Edit"
msgstr "Edita" msgstr "Edita"
#: web/template/invoices/index.gohtml:115 web/template/invoices/view.gohtml:15 #: web/template/invoices/index.gohtml:125 web/template/invoices/view.gohtml:16
msgctxt "action" msgctxt "action"
msgid "Duplicate" msgid "Duplicate"
msgstr "Duplica" msgstr "Duplica"
#: web/template/invoices/index.gohtml:125 #: web/template/invoices/index.gohtml:135
msgid "No invoices added yet." msgid "No invoices added yet."
msgstr "No hi ha cap factura." msgstr "No hi ha cap factura."
#: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:30 #: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:33
msgctxt "title" msgctxt "title"
msgid "Invoice %s" msgid "Invoice %s"
msgstr "Factura %s" msgstr "Factura %s"
#: web/template/invoices/view.gohtml:19 #: web/template/invoices/view.gohtml:22
msgctxt "action" msgctxt "action"
msgid "Download invoice" msgid "Download invoice"
msgstr "Descarrega factura" msgstr "Descarrega factura"
#: web/template/invoices/view.gohtml:58 #: web/template/invoices/view.gohtml:61
msgctxt "title" msgctxt "title"
msgid "Concept" msgid "Concept"
msgstr "Concepte" msgstr "Concepte"
#: web/template/invoices/view.gohtml:61 #: web/template/invoices/view.gohtml:64
msgctxt "title" msgctxt "title"
msgid "Discount" msgid "Discount"
msgstr "Descompte" msgstr "Descompte"
#: web/template/invoices/view.gohtml:63 #: web/template/invoices/view.gohtml:66
msgctxt "title" msgctxt "title"
msgid "Units" msgid "Units"
msgstr "Unitats" msgstr "Unitats"
#: web/template/invoices/view.gohtml:98 #: web/template/invoices/view.gohtml:101
msgctxt "title" msgctxt "title"
msgid "Tax Base" msgid "Tax Base"
msgstr "Base imposable" msgstr "Base imposable"
@ -430,7 +430,7 @@ msgctxt "action"
msgid "Update product" msgid "Update product"
msgstr "Actualitza producte" msgstr "Actualitza producte"
#: pkg/login.go:36 pkg/profile.go:40 pkg/contacts.go:216 #: pkg/login.go:36 pkg/profile.go:40 pkg/contacts.go:210
msgctxt "input" msgctxt "input"
msgid "Email" msgid "Email"
msgstr "Correu-e" msgstr "Correu-e"
@ -440,11 +440,11 @@ msgctxt "input"
msgid "Password" msgid "Password"
msgstr "Contrasenya" msgstr "Contrasenya"
#: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:312 #: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:306
msgid "Email can not be empty." msgid "Email can not be empty."
msgstr "No podeu deixar el correu-e en blanc." msgstr "No podeu deixar el correu-e en blanc."
#: pkg/login.go:70 pkg/profile.go:90 pkg/contacts.go:313 #: pkg/login.go:70 pkg/profile.go:90 pkg/contacts.go:307
msgid "This value is not a valid email. It should be like name@domain.com." msgid "This value is not a valid email. It should be like name@domain.com."
msgstr "Aquest valor no és un correu-e vàlid. Hauria de ser similar a nom@domini.cat." msgstr "Aquest valor no és un correu-e vàlid. Hauria de ser similar a nom@domini.cat."
@ -456,49 +456,49 @@ msgstr "No podeu deixar la contrasenya en blanc."
msgid "Invalid user or password." msgid "Invalid user or password."
msgstr "Nom dusuari o contrasenya incorrectes." msgstr "Nom dusuari o contrasenya incorrectes."
#: pkg/products.go:209 pkg/invoices.go:728 #: pkg/products.go:204 pkg/invoices.go:728
msgctxt "input" msgctxt "input"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: pkg/products.go:215 pkg/invoices.go:733 #: pkg/products.go:210 pkg/invoices.go:733
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripció" msgstr "Descripció"
#: pkg/products.go:220 pkg/invoices.go:737 #: pkg/products.go:215 pkg/invoices.go:737
msgctxt "input" msgctxt "input"
msgid "Price" msgid "Price"
msgstr "Preu" msgstr "Preu"
#: pkg/products.go:230 pkg/invoices.go:763 #: pkg/products.go:225 pkg/invoices.go:763
msgctxt "input" msgctxt "input"
msgid "Taxes" msgid "Taxes"
msgstr "Imposts" msgstr "Imposts"
#: pkg/products.go:236 pkg/invoices.go:192 pkg/invoices.go:571 #: pkg/products.go:231 pkg/invoices.go:187 pkg/invoices.go:578
#: pkg/contacts.go:273 #: pkg/invoices.go:960 pkg/contacts.go:267
msgctxt "input" msgctxt "input"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: pkg/products.go:255 pkg/profile.go:92 pkg/invoices.go:802 #: pkg/products.go:250 pkg/profile.go:92 pkg/invoices.go:802
msgid "Name can not be empty." msgid "Name can not be empty."
msgstr "No podeu deixar el nom en blanc." msgstr "No podeu deixar el nom en blanc."
#: pkg/products.go:256 pkg/invoices.go:803 #: pkg/products.go:251 pkg/invoices.go:803
msgid "Price can not be empty." msgid "Price can not be empty."
msgstr "No podeu deixar el preu en blanc." msgstr "No podeu deixar el preu en blanc."
#: pkg/products.go:257 pkg/invoices.go:804 #: pkg/products.go:252 pkg/invoices.go:804
msgid "Price must be a number greater than zero." msgid "Price must be a number greater than zero."
msgstr "El preu ha de ser un número major a zero." msgstr "El preu ha de ser un número major a zero."
#: pkg/products.go:259 pkg/invoices.go:812 #: pkg/products.go:254 pkg/invoices.go:812
msgid "Selected tax is not valid." msgid "Selected tax is not valid."
msgstr "Heu seleccionat un impost que no és vàlid." msgstr "Heu seleccionat un impost que no és vàlid."
#: pkg/products.go:260 pkg/invoices.go:813 #: pkg/products.go:255 pkg/invoices.go:813
msgid "You can only select a tax of each class." msgid "You can only select a tax of each class."
msgstr "Només podeu seleccionar un impost de cada classe." msgstr "Només podeu seleccionar un impost de cada classe."
@ -606,88 +606,99 @@ msgstr "La confirmació no és igual a la contrasenya."
msgid "Selected language is not valid." msgid "Selected language is not valid."
msgstr "Heu seleccionat un idioma que no és vàlid." msgstr "Heu seleccionat un idioma que no és vàlid."
#: pkg/invoices.go:165 pkg/invoices.go:549 #: pkg/invoices.go:160 pkg/invoices.go:561
msgctxt "input" msgctxt "input"
msgid "Customer" msgid "Customer"
msgstr "Client" msgstr "Client"
#: pkg/invoices.go:166 #: pkg/invoices.go:161
msgid "All customers" msgid "All customers"
msgstr "Tots els clients" msgstr "Tots els clients"
#: pkg/invoices.go:171 pkg/invoices.go:543 #: pkg/invoices.go:166 pkg/invoices.go:555
msgctxt "input" msgctxt "input"
msgid "Invoice Status" msgid "Invoice Status"
msgstr "Estat de la factura" msgstr "Estat de la factura"
#: pkg/invoices.go:172 #: pkg/invoices.go:167
msgid "All status" msgid "All status"
msgstr "Tots els estats" msgstr "Tots els estats"
#: pkg/invoices.go:177 #: pkg/invoices.go:172
msgctxt "input" msgctxt "input"
msgid "Invoice Number" msgid "Invoice Number"
msgstr "Número de factura" msgstr "Número de factura"
#: pkg/invoices.go:182 #: pkg/invoices.go:177
msgctxt "input" msgctxt "input"
msgid "From Date" msgid "From Date"
msgstr "A partir de la data" msgstr "A partir de la data"
#: pkg/invoices.go:187 #: pkg/invoices.go:182
msgctxt "input" msgctxt "input"
msgid "To Date" msgid "To Date"
msgstr "Fins la data" msgstr "Fins la data"
#: pkg/invoices.go:394 #: pkg/invoices.go:191
#, fuzzy
msgctxt "input"
msgid "Tags Condition"
msgstr "Condició de les etiquetes"
#: pkg/invoices.go:194
msgctxt "tag condition"
msgid "All"
msgstr "Totes"
#: pkg/invoices.go:197
msgctxt "tag condition"
msgid "Any"
msgstr "Qualsevol"
#: pkg/invoices.go:401
msgid "Select a customer to bill." msgid "Select a customer to bill."
msgstr "Escolliu un client a facturar." msgstr "Escolliu un client a facturar."
#: pkg/invoices.go:493 #: pkg/invoices.go:500
msgid "invoices.zip" msgid "invoices.zip"
msgstr "factures.zip" msgstr "factures.zip"
#: pkg/invoices.go:499 pkg/invoices.go:921 #: pkg/invoices.go:506 pkg/invoices.go:946
msgid "Invalid action" msgid "Invalid action"
msgstr "Acció invàlida." msgstr "Acció invàlida."
#: pkg/invoices.go:555 #: pkg/invoices.go:567
msgctxt "input"
msgid "Number"
msgstr "Número"
#: pkg/invoices.go:560
msgctxt "input" msgctxt "input"
msgid "Invoice Date" msgid "Invoice Date"
msgstr "Data de factura" msgstr "Data de factura"
#: pkg/invoices.go:566 #: pkg/invoices.go:573
msgctxt "input" msgctxt "input"
msgid "Notes" msgid "Notes"
msgstr "Notes" msgstr "Notes"
#: pkg/invoices.go:576 #: pkg/invoices.go:583
msgctxt "input" msgctxt "input"
msgid "Payment Method" msgid "Payment Method"
msgstr "Mètode de pagament" msgstr "Mètode de pagament"
#: pkg/invoices.go:613 #: pkg/invoices.go:620
msgid "Selected invoice status is not valid." msgid "Selected invoice status is not valid."
msgstr "Heu seleccionat un estat de factura que no és vàlid." msgstr "Heu seleccionat un estat de factura que no és vàlid."
#: pkg/invoices.go:614 #: pkg/invoices.go:621
msgid "Selected customer is not valid." msgid "Selected customer is not valid."
msgstr "Heu seleccionat un client que no és vàlid." msgstr "Heu seleccionat un client que no és vàlid."
#: pkg/invoices.go:615 #: pkg/invoices.go:622
msgid "Invoice date can not be empty." msgid "Invoice date can not be empty."
msgstr "No podeu deixar la data de la factura en blanc." msgstr "No podeu deixar la data de la factura en blanc."
#: pkg/invoices.go:616 #: pkg/invoices.go:623
msgid "Invoice date must be a valid date." msgid "Invoice date must be a valid date."
msgstr "La data de facturació ha de ser vàlida." msgstr "La data de facturació ha de ser vàlida."
#: pkg/invoices.go:618 #: pkg/invoices.go:625
msgid "Selected payment method is not valid." msgid "Selected payment method is not valid."
msgstr "Heu seleccionat un mètode de pagament que no és vàlid." msgstr "Heu seleccionat un mètode de pagament que no és vàlid."
@ -726,104 +737,108 @@ msgstr "No podeu deixar el descompte en blanc."
msgid "Discount must be a percentage between 0 and 100." msgid "Discount must be a percentage between 0 and 100."
msgstr "El descompte ha de ser un percentatge entre 0 i 100." msgstr "El descompte ha de ser un percentatge entre 0 i 100."
#: pkg/contacts.go:187 #: pkg/contacts.go:181
msgctxt "input" msgctxt "input"
msgid "Business name" msgid "Business name"
msgstr "Nom i cognoms" msgstr "Nom i cognoms"
#: pkg/contacts.go:196 #: pkg/contacts.go:190
msgctxt "input" msgctxt "input"
msgid "VAT number" msgid "VAT number"
msgstr "DNI / NIF" msgstr "DNI / NIF"
#: pkg/contacts.go:202 #: pkg/contacts.go:196
msgctxt "input" msgctxt "input"
msgid "Trade name" msgid "Trade name"
msgstr "Nom comercial" msgstr "Nom comercial"
#: pkg/contacts.go:207 #: pkg/contacts.go:201
msgctxt "input" msgctxt "input"
msgid "Phone" msgid "Phone"
msgstr "Telèfon" msgstr "Telèfon"
#: pkg/contacts.go:225 #: pkg/contacts.go:219
msgctxt "input" msgctxt "input"
msgid "Web" msgid "Web"
msgstr "Web" msgstr "Web"
#: pkg/contacts.go:233 #: pkg/contacts.go:227
msgctxt "input" msgctxt "input"
msgid "Address" msgid "Address"
msgstr "Adreça" msgstr "Adreça"
#: pkg/contacts.go:242 #: pkg/contacts.go:236
msgctxt "input" msgctxt "input"
msgid "City" msgid "City"
msgstr "Població" msgstr "Població"
#: pkg/contacts.go:248 #: pkg/contacts.go:242
msgctxt "input" msgctxt "input"
msgid "Province" msgid "Province"
msgstr "Província" msgstr "Província"
#: pkg/contacts.go:254 #: pkg/contacts.go:248
msgctxt "input" msgctxt "input"
msgid "Postal code" msgid "Postal code"
msgstr "Codi postal" msgstr "Codi postal"
#: pkg/contacts.go:263 #: pkg/contacts.go:257
msgctxt "input" msgctxt "input"
msgid "Country" msgid "Country"
msgstr "País" msgstr "País"
#: pkg/contacts.go:301 #: pkg/contacts.go:295
msgid "Selected country is not valid." msgid "Selected country is not valid."
msgstr "Heu seleccionat un país que no és vàlid." msgstr "Heu seleccionat un país que no és vàlid."
#: pkg/contacts.go:305 #: pkg/contacts.go:299
msgid "Business name can not be empty." msgid "Business name can not be empty."
msgstr "No podeu deixar el nom i els cognoms en blanc." msgstr "No podeu deixar el nom i els cognoms en blanc."
#: pkg/contacts.go:306 #: pkg/contacts.go:300
msgid "VAT number can not be empty." msgid "VAT number can not be empty."
msgstr "No podeu deixar el DNI o NIF en blanc." msgstr "No podeu deixar el DNI o NIF en blanc."
#: pkg/contacts.go:307 #: pkg/contacts.go:301
msgid "This value is not a valid VAT number." msgid "This value is not a valid VAT number."
msgstr "Aquest valor no és un DNI o NIF vàlid." msgstr "Aquest valor no és un DNI o NIF vàlid."
#: pkg/contacts.go:309 #: pkg/contacts.go:303
msgid "Phone can not be empty." msgid "Phone can not be empty."
msgstr "No podeu deixar el telèfon en blanc." msgstr "No podeu deixar el telèfon en blanc."
#: pkg/contacts.go:310 #: pkg/contacts.go:304
msgid "This value is not a valid phone number." msgid "This value is not a valid phone number."
msgstr "Aquest valor no és un telèfon vàlid." msgstr "Aquest valor no és un telèfon vàlid."
#: pkg/contacts.go:316 #: pkg/contacts.go:310
msgid "This value is not a valid web address. It should be like https://domain.com/." msgid "This value is not a valid web address. It should be like https://domain.com/."
msgstr "Aquest valor no és una adreça web vàlida. Hauria de ser similar a https://domini.cat/." msgstr "Aquest valor no és una adreça web vàlida. Hauria de ser similar a https://domini.cat/."
#: pkg/contacts.go:318 #: pkg/contacts.go:312
msgid "Address can not be empty." msgid "Address can not be empty."
msgstr "No podeu deixar ladreça en blanc." msgstr "No podeu deixar ladreça en blanc."
#: pkg/contacts.go:319 #: pkg/contacts.go:313
msgid "City can not be empty." msgid "City can not be empty."
msgstr "No podeu deixar la població en blanc." msgstr "No podeu deixar la població en blanc."
#: pkg/contacts.go:320 #: pkg/contacts.go:314
msgid "Province can not be empty." msgid "Province can not be empty."
msgstr "No podeu deixar la província en blanc." msgstr "No podeu deixar la província en blanc."
#: pkg/contacts.go:321 #: pkg/contacts.go:315
msgid "Postal code can not be empty." msgid "Postal code can not be empty."
msgstr "No podeu deixar el codi postal en blanc." msgstr "No podeu deixar el codi postal en blanc."
#: pkg/contacts.go:322 #: pkg/contacts.go:316
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 "input"
#~ msgid "Number"
#~ msgstr "Número"
#~ msgctxt "title" #~ msgctxt "title"
#~ msgid "Label" #~ msgid "Label"
#~ msgstr "Etiqueta" #~ msgstr "Etiqueta"

194
po/es.po
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-03-29 16:08+0200\n" "POT-Creation-Date: 2023-04-15 04:00+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"
@ -47,43 +47,43 @@ msgctxt "title"
msgid "New Invoice" msgid "New Invoice"
msgstr "Nueva factura" msgstr "Nueva factura"
#: web/template/invoices/products.gohtml:51 #: web/template/invoices/products.gohtml:49
#: web/template/products/index.gohtml:25 #: web/template/products/index.gohtml:25
msgctxt "product" msgctxt "product"
msgid "All" msgid "All"
msgstr "Todos" msgstr "Todos"
#: web/template/invoices/products.gohtml:52 #: web/template/invoices/products.gohtml:50
#: web/template/products/index.gohtml:26 #: web/template/products/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
#: web/template/invoices/products.gohtml:53 #: web/template/invoices/products.gohtml:51
#: web/template/invoices/view.gohtml:59 web/template/products/index.gohtml:28 #: web/template/invoices/view.gohtml:62 web/template/products/index.gohtml:28
msgctxt "title" msgctxt "title"
msgid "Price" msgid "Price"
msgstr "Precio" msgstr "Precio"
#: web/template/invoices/products.gohtml:67 #: web/template/invoices/products.gohtml:65
#: web/template/products/index.gohtml:48 #: web/template/products/index.gohtml:48
msgid "No products added yet." msgid "No products added yet."
msgstr "No hay productos." msgstr "No hay productos."
#: web/template/invoices/products.gohtml:75 web/template/invoices/new.gohtml:67 #: web/template/invoices/products.gohtml:73 web/template/invoices/new.gohtml:67
#: web/template/invoices/edit.gohtml:68 #: web/template/invoices/edit.gohtml:68
msgctxt "action" msgctxt "action"
msgid "Add products" msgid "Add products"
msgstr "Añadir productos" msgstr "Añadir productos"
#: web/template/invoices/new.gohtml:48 web/template/invoices/view.gohtml:64 #: web/template/invoices/new.gohtml:48 web/template/invoices/view.gohtml:67
#: web/template/invoices/edit.gohtml:49 #: web/template/invoices/edit.gohtml:49
msgctxt "title" msgctxt "title"
msgid "Subtotal" msgid "Subtotal"
msgstr "Subtotal" msgstr "Subtotal"
#: web/template/invoices/new.gohtml:58 web/template/invoices/view.gohtml:68 #: web/template/invoices/new.gohtml:58 web/template/invoices/view.gohtml:71
#: web/template/invoices/view.gohtml:108 web/template/invoices/edit.gohtml:59 #: web/template/invoices/view.gohtml:111 web/template/invoices/edit.gohtml:59
msgctxt "title" msgctxt "title"
msgid "Total" msgid "Total"
msgstr "Total" msgstr "Total"
@ -93,7 +93,7 @@ msgctxt "action"
msgid "Update" msgid "Update"
msgstr "Actualizar" msgstr "Actualizar"
#: web/template/invoices/new.gohtml:72 web/template/invoices/index.gohtml:20 #: web/template/invoices/new.gohtml:72 web/template/invoices/index.gohtml:21
msgctxt "action" msgctxt "action"
msgid "New invoice" msgid "New invoice"
msgstr "Nueva factura" msgstr "Nueva factura"
@ -103,102 +103,102 @@ msgctxt "action"
msgid "Download invoices" msgid "Download invoices"
msgstr "Descargar facturas" msgstr "Descargar facturas"
#: web/template/invoices/index.gohtml:38 #: web/template/invoices/index.gohtml:41
msgctxt "action" msgctxt "action"
msgid "Filter" msgid "Filter"
msgstr "Filtrar" msgstr "Filtrar"
#: web/template/invoices/index.gohtml:44 #: web/template/invoices/index.gohtml:47
msgctxt "invoice" msgctxt "invoice"
msgid "All" msgid "All"
msgstr "Todas" msgstr "Todas"
#: web/template/invoices/index.gohtml:45 web/template/invoices/view.gohtml:31 #: web/template/invoices/index.gohtml:48 web/template/invoices/view.gohtml:34
msgctxt "title" msgctxt "title"
msgid "Date" msgid "Date"
msgstr "Fecha" msgstr "Fecha"
#: web/template/invoices/index.gohtml:46 #: web/template/invoices/index.gohtml:49
msgctxt "title" msgctxt "title"
msgid "Invoice Num." msgid "Invoice Num."
msgstr "Nº factura" msgstr "Nº factura"
#: web/template/invoices/index.gohtml:47 web/template/contacts/index.gohtml:26 #: web/template/invoices/index.gohtml:50 web/template/contacts/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Customer" msgid "Customer"
msgstr "Cliente" msgstr "Cliente"
#: web/template/invoices/index.gohtml:48 #: web/template/invoices/index.gohtml:51
msgctxt "title" msgctxt "title"
msgid "Status" msgid "Status"
msgstr "Estado" msgstr "Estado"
#: web/template/invoices/index.gohtml:49 web/template/contacts/index.gohtml:29 #: web/template/invoices/index.gohtml:52 web/template/contacts/index.gohtml:29
#: web/template/products/index.gohtml:27 #: web/template/products/index.gohtml:27
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: web/template/invoices/index.gohtml:50 #: web/template/invoices/index.gohtml:53
msgctxt "title" msgctxt "title"
msgid "Amount" msgid "Amount"
msgstr "Importe" msgstr "Importe"
#: web/template/invoices/index.gohtml:51 #: web/template/invoices/index.gohtml:54
msgctxt "title" msgctxt "title"
msgid "Download" msgid "Download"
msgstr "Descargar" msgstr "Descargar"
#: web/template/invoices/index.gohtml:52 #: web/template/invoices/index.gohtml:55
msgctxt "title" msgctxt "title"
msgid "Actions" msgid "Actions"
msgstr "Acciones" msgstr "Acciones"
#: web/template/invoices/index.gohtml:59 #: web/template/invoices/index.gohtml:62
msgctxt "action" msgctxt "action"
msgid "Select invoice %v" msgid "Select invoice %v"
msgstr "Seleccionar factura %v" msgstr "Seleccionar factura %v"
#: web/template/invoices/index.gohtml:109 web/template/invoices/view.gohtml:16 #: web/template/invoices/index.gohtml:117 web/template/invoices/view.gohtml:19
msgctxt "action" msgctxt "action"
msgid "Edit" msgid "Edit"
msgstr "Editar" msgstr "Editar"
#: web/template/invoices/index.gohtml:115 web/template/invoices/view.gohtml:15 #: web/template/invoices/index.gohtml:125 web/template/invoices/view.gohtml:16
msgctxt "action" msgctxt "action"
msgid "Duplicate" msgid "Duplicate"
msgstr "Duplicar" msgstr "Duplicar"
#: web/template/invoices/index.gohtml:125 #: web/template/invoices/index.gohtml:135
msgid "No invoices added yet." msgid "No invoices added yet."
msgstr "No hay facturas." msgstr "No hay facturas."
#: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:30 #: web/template/invoices/view.gohtml:2 web/template/invoices/view.gohtml:33
msgctxt "title" msgctxt "title"
msgid "Invoice %s" msgid "Invoice %s"
msgstr "Factura %s" msgstr "Factura %s"
#: web/template/invoices/view.gohtml:19 #: web/template/invoices/view.gohtml:22
msgctxt "action" msgctxt "action"
msgid "Download invoice" msgid "Download invoice"
msgstr "Descargar factura" msgstr "Descargar factura"
#: web/template/invoices/view.gohtml:58 #: web/template/invoices/view.gohtml:61
msgctxt "title" msgctxt "title"
msgid "Concept" msgid "Concept"
msgstr "Concepto" msgstr "Concepto"
#: web/template/invoices/view.gohtml:61 #: web/template/invoices/view.gohtml:64
msgctxt "title" msgctxt "title"
msgid "Discount" msgid "Discount"
msgstr "Descuento" msgstr "Descuento"
#: web/template/invoices/view.gohtml:63 #: web/template/invoices/view.gohtml:66
msgctxt "title" msgctxt "title"
msgid "Units" msgid "Units"
msgstr "Unidades" msgstr "Unidades"
#: web/template/invoices/view.gohtml:98 #: web/template/invoices/view.gohtml:101
msgctxt "title" msgctxt "title"
msgid "Tax Base" msgid "Tax Base"
msgstr "Base imponible" msgstr "Base imponible"
@ -430,7 +430,7 @@ msgctxt "action"
msgid "Update product" msgid "Update product"
msgstr "Actualizar producto" msgstr "Actualizar producto"
#: pkg/login.go:36 pkg/profile.go:40 pkg/contacts.go:216 #: pkg/login.go:36 pkg/profile.go:40 pkg/contacts.go:210
msgctxt "input" msgctxt "input"
msgid "Email" msgid "Email"
msgstr "Correo-e" msgstr "Correo-e"
@ -440,11 +440,11 @@ msgctxt "input"
msgid "Password" msgid "Password"
msgstr "Contraseña" msgstr "Contraseña"
#: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:312 #: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:306
msgid "Email can not be empty." msgid "Email can not be empty."
msgstr "No podéis dejar el correo-e en blanco." msgstr "No podéis dejar el correo-e en blanco."
#: pkg/login.go:70 pkg/profile.go:90 pkg/contacts.go:313 #: pkg/login.go:70 pkg/profile.go:90 pkg/contacts.go:307
msgid "This value is not a valid email. It should be like name@domain.com." msgid "This value is not a valid email. It should be like name@domain.com."
msgstr "Este valor no es un correo-e válido. Tiene que ser parecido a nombre@dominio.es." msgstr "Este valor no es un correo-e válido. Tiene que ser parecido a nombre@dominio.es."
@ -456,49 +456,49 @@ msgstr "No podéis dejar la contraseña en blanco."
msgid "Invalid user or password." msgid "Invalid user or password."
msgstr "Nombre de usuario o contraseña inválido." msgstr "Nombre de usuario o contraseña inválido."
#: pkg/products.go:209 pkg/invoices.go:728 #: pkg/products.go:204 pkg/invoices.go:728
msgctxt "input" msgctxt "input"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
#: pkg/products.go:215 pkg/invoices.go:733 #: pkg/products.go:210 pkg/invoices.go:733
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripción" msgstr "Descripción"
#: pkg/products.go:220 pkg/invoices.go:737 #: pkg/products.go:215 pkg/invoices.go:737
msgctxt "input" msgctxt "input"
msgid "Price" msgid "Price"
msgstr "Precio" msgstr "Precio"
#: pkg/products.go:230 pkg/invoices.go:763 #: pkg/products.go:225 pkg/invoices.go:763
msgctxt "input" msgctxt "input"
msgid "Taxes" msgid "Taxes"
msgstr "Impuestos" msgstr "Impuestos"
#: pkg/products.go:236 pkg/invoices.go:192 pkg/invoices.go:571 #: pkg/products.go:231 pkg/invoices.go:187 pkg/invoices.go:578
#: pkg/contacts.go:273 #: pkg/invoices.go:960 pkg/contacts.go:267
msgctxt "input" msgctxt "input"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
#: pkg/products.go:255 pkg/profile.go:92 pkg/invoices.go:802 #: pkg/products.go:250 pkg/profile.go:92 pkg/invoices.go:802
msgid "Name can not be empty." msgid "Name can not be empty."
msgstr "No podéis dejar el nombre en blanco." msgstr "No podéis dejar el nombre en blanco."
#: pkg/products.go:256 pkg/invoices.go:803 #: pkg/products.go:251 pkg/invoices.go:803
msgid "Price can not be empty." msgid "Price can not be empty."
msgstr "No podéis dejar el precio en blanco." msgstr "No podéis dejar el precio en blanco."
#: pkg/products.go:257 pkg/invoices.go:804 #: pkg/products.go:252 pkg/invoices.go:804
msgid "Price must be a number greater than zero." msgid "Price must be a number greater than zero."
msgstr "El precio tiene que ser un número mayor a cero." msgstr "El precio tiene que ser un número mayor a cero."
#: pkg/products.go:259 pkg/invoices.go:812 #: pkg/products.go:254 pkg/invoices.go:812
msgid "Selected tax is not valid." msgid "Selected tax is not valid."
msgstr "Habéis escogido un impuesto que no es válido." msgstr "Habéis escogido un impuesto que no es válido."
#: pkg/products.go:260 pkg/invoices.go:813 #: pkg/products.go:255 pkg/invoices.go:813
msgid "You can only select a tax of each class." msgid "You can only select a tax of each class."
msgstr "Solo podéis escoger un impuesto de cada clase." msgstr "Solo podéis escoger un impuesto de cada clase."
@ -606,88 +606,98 @@ msgstr "La confirmación no corresponde con la contraseña."
msgid "Selected language is not valid." msgid "Selected language is not valid."
msgstr "Habéis escogido un idioma que no es válido." msgstr "Habéis escogido un idioma que no es válido."
#: pkg/invoices.go:165 pkg/invoices.go:549 #: pkg/invoices.go:160 pkg/invoices.go:561
msgctxt "input" msgctxt "input"
msgid "Customer" msgid "Customer"
msgstr "Cliente" msgstr "Cliente"
#: pkg/invoices.go:166 #: pkg/invoices.go:161
msgid "All customers" msgid "All customers"
msgstr "Todos los clientes" msgstr "Todos los clientes"
#: pkg/invoices.go:171 pkg/invoices.go:543 #: pkg/invoices.go:166 pkg/invoices.go:555
msgctxt "input" msgctxt "input"
msgid "Invoice Status" msgid "Invoice Status"
msgstr "Estado de la factura" msgstr "Estado de la factura"
#: pkg/invoices.go:172 #: pkg/invoices.go:167
msgid "All status" msgid "All status"
msgstr "Todos los estados" msgstr "Todos los estados"
#: pkg/invoices.go:177 #: pkg/invoices.go:172
msgctxt "input" msgctxt "input"
msgid "Invoice Number" msgid "Invoice Number"
msgstr "Número de factura" msgstr "Número de factura"
#: pkg/invoices.go:182 #: pkg/invoices.go:177
msgctxt "input" msgctxt "input"
msgid "From Date" msgid "From Date"
msgstr "A partir de la fecha" msgstr "A partir de la fecha"
#: pkg/invoices.go:187 #: pkg/invoices.go:182
msgctxt "input" msgctxt "input"
msgid "To Date" msgid "To Date"
msgstr "Hasta la fecha" msgstr "Hasta la fecha"
#: pkg/invoices.go:394 #: pkg/invoices.go:191
msgctxt "input"
msgid "Tags Condition"
msgstr "Condición de las etiquetas"
#: pkg/invoices.go:194
msgctxt "tag condition"
msgid "All"
msgstr "Todas"
#: pkg/invoices.go:197
msgctxt "tag condition"
msgid "Any"
msgstr "Cualquiera"
#: pkg/invoices.go:401
msgid "Select a customer to bill." msgid "Select a customer to bill."
msgstr "Escoged un cliente a facturar." msgstr "Escoged un cliente a facturar."
#: pkg/invoices.go:493 #: pkg/invoices.go:500
msgid "invoices.zip" msgid "invoices.zip"
msgstr "facturas.zip" msgstr "facturas.zip"
#: pkg/invoices.go:499 pkg/invoices.go:921 #: pkg/invoices.go:506 pkg/invoices.go:946
msgid "Invalid action" msgid "Invalid action"
msgstr "Acción inválida." msgstr "Acción inválida."
#: pkg/invoices.go:555 #: pkg/invoices.go:567
msgctxt "input"
msgid "Number"
msgstr "Número"
#: pkg/invoices.go:560
msgctxt "input" msgctxt "input"
msgid "Invoice Date" msgid "Invoice Date"
msgstr "Fecha de factura" msgstr "Fecha de factura"
#: pkg/invoices.go:566 #: pkg/invoices.go:573
msgctxt "input" msgctxt "input"
msgid "Notes" msgid "Notes"
msgstr "Notas" msgstr "Notas"
#: pkg/invoices.go:576 #: pkg/invoices.go:583
msgctxt "input" msgctxt "input"
msgid "Payment Method" msgid "Payment Method"
msgstr "Método de pago" msgstr "Método de pago"
#: pkg/invoices.go:613 #: pkg/invoices.go:620
msgid "Selected invoice status is not valid." msgid "Selected invoice status is not valid."
msgstr "Habéis escogido un estado de factura que no es válido." msgstr "Habéis escogido un estado de factura que no es válido."
#: pkg/invoices.go:614 #: pkg/invoices.go:621
msgid "Selected customer is not valid." msgid "Selected customer is not valid."
msgstr "Habéis escogido un cliente que no es válido." msgstr "Habéis escogido un cliente que no es válido."
#: pkg/invoices.go:615 #: pkg/invoices.go:622
msgid "Invoice date can not be empty." msgid "Invoice date can not be empty."
msgstr "No podéis dejar la fecha de la factura en blanco." msgstr "No podéis dejar la fecha de la factura en blanco."
#: pkg/invoices.go:616 #: pkg/invoices.go:623
msgid "Invoice date must be a valid date." msgid "Invoice date must be a valid date."
msgstr "La fecha de factura debe ser válida." msgstr "La fecha de factura debe ser válida."
#: pkg/invoices.go:618 #: pkg/invoices.go:625
msgid "Selected payment method is not valid." msgid "Selected payment method is not valid."
msgstr "Habéis escogido un método de pago que no es válido." msgstr "Habéis escogido un método de pago que no es válido."
@ -726,104 +736,108 @@ msgstr "No podéis dejar el descuento en blanco."
msgid "Discount must be a percentage between 0 and 100." msgid "Discount must be a percentage between 0 and 100."
msgstr "El descuento tiene que ser un porcentaje entre 0 y 100." msgstr "El descuento tiene que ser un porcentaje entre 0 y 100."
#: pkg/contacts.go:187 #: pkg/contacts.go:181
msgctxt "input" msgctxt "input"
msgid "Business name" msgid "Business name"
msgstr "Nombre y apellidos" msgstr "Nombre y apellidos"
#: pkg/contacts.go:196 #: pkg/contacts.go:190
msgctxt "input" msgctxt "input"
msgid "VAT number" msgid "VAT number"
msgstr "DNI / NIF" msgstr "DNI / NIF"
#: pkg/contacts.go:202 #: pkg/contacts.go:196
msgctxt "input" msgctxt "input"
msgid "Trade name" msgid "Trade name"
msgstr "Nombre comercial" msgstr "Nombre comercial"
#: pkg/contacts.go:207 #: pkg/contacts.go:201
msgctxt "input" msgctxt "input"
msgid "Phone" msgid "Phone"
msgstr "Teléfono" msgstr "Teléfono"
#: pkg/contacts.go:225 #: pkg/contacts.go:219
msgctxt "input" msgctxt "input"
msgid "Web" msgid "Web"
msgstr "Web" msgstr "Web"
#: pkg/contacts.go:233 #: pkg/contacts.go:227
msgctxt "input" msgctxt "input"
msgid "Address" msgid "Address"
msgstr "Dirección" msgstr "Dirección"
#: pkg/contacts.go:242 #: pkg/contacts.go:236
msgctxt "input" msgctxt "input"
msgid "City" msgid "City"
msgstr "Población" msgstr "Población"
#: pkg/contacts.go:248 #: pkg/contacts.go:242
msgctxt "input" msgctxt "input"
msgid "Province" msgid "Province"
msgstr "Provincia" msgstr "Provincia"
#: pkg/contacts.go:254 #: pkg/contacts.go:248
msgctxt "input" msgctxt "input"
msgid "Postal code" msgid "Postal code"
msgstr "Código postal" msgstr "Código postal"
#: pkg/contacts.go:263 #: pkg/contacts.go:257
msgctxt "input" msgctxt "input"
msgid "Country" msgid "Country"
msgstr "País" msgstr "País"
#: pkg/contacts.go:301 #: pkg/contacts.go:295
msgid "Selected country is not valid." msgid "Selected country is not valid."
msgstr "Habéis escogido un país que no es válido." msgstr "Habéis escogido un país que no es válido."
#: pkg/contacts.go:305 #: pkg/contacts.go:299
msgid "Business name can not be empty." msgid "Business name can not be empty."
msgstr "No podéis dejar el nombre y los apellidos en blanco." msgstr "No podéis dejar el nombre y los apellidos en blanco."
#: pkg/contacts.go:306 #: pkg/contacts.go:300
msgid "VAT number can not be empty." msgid "VAT number can not be empty."
msgstr "No podéis dejar el DNI o NIF en blanco." msgstr "No podéis dejar el DNI o NIF en blanco."
#: pkg/contacts.go:307 #: pkg/contacts.go:301
msgid "This value is not a valid VAT number." msgid "This value is not a valid VAT number."
msgstr "Este valor no es un DNI o NIF válido." msgstr "Este valor no es un DNI o NIF válido."
#: pkg/contacts.go:309 #: pkg/contacts.go:303
msgid "Phone can not be empty." msgid "Phone can not be empty."
msgstr "No podéis dejar el teléfono en blanco." msgstr "No podéis dejar el teléfono en blanco."
#: pkg/contacts.go:310 #: pkg/contacts.go:304
msgid "This value is not a valid phone number." msgid "This value is not a valid phone number."
msgstr "Este valor no es un teléfono válido." msgstr "Este valor no es un teléfono válido."
#: pkg/contacts.go:316 #: pkg/contacts.go:310
msgid "This value is not a valid web address. It should be like https://domain.com/." msgid "This value is not a valid web address. It should be like https://domain.com/."
msgstr "Este valor no es una dirección web válida. Tiene que ser parecida a https://dominio.es/." msgstr "Este valor no es una dirección web válida. Tiene que ser parecida a https://dominio.es/."
#: pkg/contacts.go:318 #: pkg/contacts.go:312
msgid "Address can not be empty." msgid "Address can not be empty."
msgstr "No podéis dejar la dirección en blanco." msgstr "No podéis dejar la dirección en blanco."
#: pkg/contacts.go:319 #: pkg/contacts.go:313
msgid "City can not be empty." msgid "City can not be empty."
msgstr "No podéis dejar la población en blanco." msgstr "No podéis dejar la población en blanco."
#: pkg/contacts.go:320 #: pkg/contacts.go:314
msgid "Province can not be empty." msgid "Province can not be empty."
msgstr "No podéis dejar la provincia en blanco." msgstr "No podéis dejar la provincia en blanco."
#: pkg/contacts.go:321 #: pkg/contacts.go:315
msgid "Postal code can not be empty." msgid "Postal code can not be empty."
msgstr "No podéis dejar el código postal en blanco." msgstr "No podéis dejar el código postal en blanco."
#: pkg/contacts.go:322 #: pkg/contacts.go:316
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 "input"
#~ msgid "Number"
#~ msgstr "Número"
#~ msgctxt "title" #~ msgctxt "title"
#~ msgid "Label" #~ msgid "Label"
#~ msgstr "Etiqueta" #~ msgstr "Etiqueta"

View File

@ -374,11 +374,22 @@ input.width-2x {
transition: 0.2s; transition: 0.2s;
} }
.input[is="numerus-toggle"] label {
position: initial;
font-style: initial;
pointer-events: initial;
font-size: inherit;
padding: initial;
}
fieldset { fieldset {
border: none; border: none;
padding: 2rem 0 0; padding: 2rem 0 0;
margin-top: 3rem; margin-top: 3rem;
border-top: 1px solid var(--numerus--color--light-gray); border-top: 1px solid var(--numerus--color--light-gray);
display: flex;
flex-wrap: wrap;
justify-content: space-between;
} }
legend { legend {
@ -392,10 +403,17 @@ legend + * {
clear: both; clear: both;
} }
fieldset { fieldset[is="numerus-toggle"] {
display: flex; display: inline-flex;
flex-wrap: wrap; border-top: none;
justify-content: space-between; margin: 0;
padding: 0;
}
fieldset[is="numerus-toggle"] legend {
float: revert;
margin: 0;
width: initial;
} }
.full-width { .full-width {

View File

@ -92,3 +92,12 @@
{{- end }} {{- end }}
</div> </div>
{{- end }} {{- end }}
{{ define "toggle-field" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.ToggleField*/ -}}
<fieldset class="input{{ if .Errors }} has-errors{{ end }}" is="numerus-toggle">
<legend>{{ .Label }}</legend>
<label><input type="radio" name="{{ .Name }}" value="{{ .FirstOption.Value }}" {{ if eq .Selected .FirstOption.Value}}checked{{ end }}> {{ .FirstOption.Label }}</label>
<label><input type="radio" name="{{ .Name }}" value="{{ .SecondOption.Value }}" {{ if eq .Selected .SecondOption.Value}}checked{{ end }}> {{ .SecondOption.Label }}</label>
</fieldset>
{{- end }}

View File

@ -36,7 +36,7 @@
{{ template "input-field" .ToDate }} {{ template "input-field" .ToDate }}
{{ template "input-field" .InvoiceNumber }} {{ template "input-field" .InvoiceNumber }}
{{ template "tags-field" .Tags }} {{ template "tags-field" .Tags }}
{{ template "select-field" .TagsCondition }} {{ template "toggle-field" .TagsCondition }}
{{ end }} {{ end }}
<button type="submit">{{( pgettext "Filter" "action" )}}</button> <button type="submit">{{( pgettext "Filter" "action" )}}</button>
</form> </form>