Compare commits

..

2 Commits

Author SHA1 Message Date
jordi fita mas 47c23fc4cc Boost the products’ section links and forms
Had to add the editProductPage because now i need to know the slug in
order to build the form’s action link.  I also added the `ProductName`
field because it was less awkward than using `.Form.Name` everywhere.
2023-03-27 09:44:04 +02:00
jordi fita mas 2086f68bd8 Boost contact’s tag links to update <main> with the filtered list 2023-03-27 09:40:24 +02:00
7 changed files with 241 additions and 205 deletions

View File

@ -47,15 +47,26 @@ func GetProductForm(w http.ResponseWriter, r *http.Request, params httprouter.Pa
return return
} }
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
mustRenderEditProductForm(w, r, form) mustRenderEditProductForm(w, r, slug, form)
} }
func mustRenderNewProductForm(w http.ResponseWriter, r *http.Request, form *productForm) { func mustRenderNewProductForm(w http.ResponseWriter, r *http.Request, form *productForm) {
mustRenderAppTemplate(w, r, "products/new.gohtml", form) mustRenderModalTemplate(w, r, "products/new.gohtml", form)
} }
func mustRenderEditProductForm(w http.ResponseWriter, r *http.Request, form *productForm) { type editProductPage struct {
mustRenderAppTemplate(w, r, "products/edit.gohtml", form) Slug string
ProductName string
Form *productForm
}
func mustRenderEditProductForm(w http.ResponseWriter, r *http.Request, slug string, form *productForm) {
page := &editProductPage{
Slug: slug,
ProductName: form.Name.Val,
Form: form,
}
mustRenderModalTemplate(w, r, "products/edit.gohtml", page)
} }
func HandleAddProduct(w http.ResponseWriter, r *http.Request, _ httprouter.Params) { func HandleAddProduct(w http.ResponseWriter, r *http.Request, _ httprouter.Params) {
@ -72,12 +83,21 @@ func HandleAddProduct(w http.ResponseWriter, r *http.Request, _ httprouter.Param
return return
} }
if !form.Validate() { if !form.Validate() {
if !IsHTMxRequest(r) {
w.WriteHeader(http.StatusUnprocessableEntity)
}
mustRenderNewProductForm(w, r, form) mustRenderNewProductForm(w, r, form)
return return
} }
taxes := mustSliceAtoi(form.Tax.Selected) taxes := mustSliceAtoi(form.Tax.Selected)
conn.MustExec(r.Context(), "select add_product($1, $2, $3, $4, $5, $6)", company.Id, form.Name, form.Description, form.Price, taxes, form.Tags) conn.MustExec(r.Context(), "select add_product($1, $2, $3, $4, $5, $6)", company.Id, form.Name, form.Description, form.Price, taxes, form.Tags)
if IsHTMxRequest(r) {
w.Header().Set("HX-Trigger", "closeModal")
w.Header().Set("HX-Refresh", "true")
w.WriteHeader(http.StatusNoContent)
} else {
http.Redirect(w, r, companyURI(company, "/products"), http.StatusSeeOther) http.Redirect(w, r, companyURI(company, "/products"), http.StatusSeeOther)
}
} }
func sliceAtoi(s []string) ([]int, error) { func sliceAtoi(s []string) ([]int, error) {
@ -113,17 +133,23 @@ func HandleUpdateProduct(w http.ResponseWriter, r *http.Request, params httprout
http.Error(w, err.Error(), http.StatusForbidden) http.Error(w, err.Error(), http.StatusForbidden)
return return
} }
slug := params[0].Value
if !form.Validate() { if !form.Validate() {
w.WriteHeader(http.StatusUnprocessableEntity) w.WriteHeader(http.StatusUnprocessableEntity)
mustRenderEditProductForm(w, r, form) mustRenderEditProductForm(w, r, slug, form)
return return
} }
slug := params[0].Value
taxes := mustSliceAtoi(form.Tax.Selected) taxes := mustSliceAtoi(form.Tax.Selected)
if ok := conn.MustGetBool(r.Context(), "select edit_product($1, $2, $3, $4, $5, $6)", slug, form.Name, form.Description, form.Price, taxes, form.Tags); !ok { if ok := conn.MustGetBool(r.Context(), "select edit_product($1, $2, $3, $4, $5, $6)", slug, form.Name, form.Description, form.Price, taxes, form.Tags); !ok {
http.NotFound(w, r) http.NotFound(w, r)
} }
if IsHTMxRequest(r) {
w.Header().Set("HX-Trigger", "closeModal")
w.Header().Set("HX-Refresh", "true")
w.WriteHeader(http.StatusNoContent)
} else {
http.Redirect(w, r, companyURI(company, "/products/"+slug), http.StatusSeeOther) http.Redirect(w, r, companyURI(company, "/products/"+slug), http.StatusSeeOther)
}
} }
func mustCollectProductEntries(ctx context.Context, conn *Conn, company *Company, tag string) []*ProductEntry { func mustCollectProductEntries(ctx context.Context, conn *Conn, company *Company, tag string) []*ProductEntry {

179
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-21 11:56+0100\n" "POT-Creation-Date: 2023-03-27 09:43+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"
@ -26,10 +26,10 @@ msgstr "Afegeix productes a la factura"
#: web/template/invoices/products.gohtml:9 web/template/invoices/new.gohtml:9 #: web/template/invoices/products.gohtml:9 web/template/invoices/new.gohtml:9
#: web/template/invoices/index.gohtml:9 web/template/invoices/view.gohtml:9 #: web/template/invoices/index.gohtml:9 web/template/invoices/view.gohtml:9
#: web/template/invoices/edit.gohtml:9 web/template/contacts/new.gohtml:9 #: web/template/invoices/edit.gohtml:9 web/template/contacts/new.gohtml:9
#: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:9 #: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:10
#: web/template/profile.gohtml:9 web/template/tax-details.gohtml:9 #: web/template/profile.gohtml:9 web/template/tax-details.gohtml:9
#: web/template/products/new.gohtml:9 web/template/products/index.gohtml:9 #: web/template/products/new.gohtml:9 web/template/products/index.gohtml:9
#: web/template/products/edit.gohtml:9 #: web/template/products/edit.gohtml:10
msgctxt "title" msgctxt "title"
msgid "Home" msgid "Home"
msgstr "Inici" msgstr "Inici"
@ -48,25 +48,25 @@ msgid "New Invoice"
msgstr "Nova factura" msgstr "Nova factura"
#: web/template/invoices/products.gohtml:51 #: web/template/invoices/products.gohtml:51
#: web/template/products/index.gohtml:24 #: 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:52
#: web/template/products/index.gohtml:25 #: 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:53
#: web/template/invoices/view.gohtml:59 web/template/products/index.gohtml:26 #: web/template/invoices/view.gohtml:59 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:67
#: web/template/products/index.gohtml:40 #: 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."
@ -118,7 +118,7 @@ msgctxt "title"
msgid "Invoice Num." msgid "Invoice Num."
msgstr "Núm. factura" msgstr "Núm. factura"
#: web/template/invoices/index.gohtml:34 web/template/contacts/index.gohtml:25 #: web/template/invoices/index.gohtml:34 web/template/contacts/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Customer" msgid "Customer"
msgstr "Client" msgstr "Client"
@ -128,7 +128,8 @@ msgctxt "title"
msgid "Status" msgid "Status"
msgstr "Estat" msgstr "Estat"
#: web/template/invoices/index.gohtml:36 #: web/template/invoices/index.gohtml:36 web/template/contacts/index.gohtml:29
#: web/template/products/index.gohtml:27
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
@ -212,37 +213,37 @@ msgctxt "title"
msgid "Dashboard" msgid "Dashboard"
msgstr "Tauler" msgstr "Tauler"
#: web/template/app.gohtml:22 #: web/template/app.gohtml:23
msgctxt "menu" msgctxt "menu"
msgid "Account" msgid "Account"
msgstr "Compte" msgstr "Compte"
#: web/template/app.gohtml:28 #: web/template/app.gohtml:29
msgctxt "menu" msgctxt "menu"
msgid "Tax Details" msgid "Tax Details"
msgstr "Configuració fiscal" msgstr "Configuració fiscal"
#: web/template/app.gohtml:36 #: web/template/app.gohtml:37
msgctxt "action" msgctxt "action"
msgid "Logout" msgid "Logout"
msgstr "Surt" msgstr "Surt"
#: web/template/app.gohtml:45 #: web/template/app.gohtml:46
msgctxt "nav" msgctxt "nav"
msgid "Dashboard" msgid "Dashboard"
msgstr "Tauler" msgstr "Tauler"
#: web/template/app.gohtml:46 #: web/template/app.gohtml:47
msgctxt "nav" msgctxt "nav"
msgid "Invoices" msgid "Invoices"
msgstr "Factures" msgstr "Factures"
#: web/template/app.gohtml:47 #: web/template/app.gohtml:48
msgctxt "nav" msgctxt "nav"
msgid "Products" msgid "Products"
msgstr "Productes" msgstr "Productes"
#: web/template/app.gohtml:48 #: web/template/app.gohtml:49
msgctxt "nav" msgctxt "nav"
msgid "Contacts" msgid "Contacts"
msgstr "Contactes" msgstr "Contactes"
@ -254,41 +255,41 @@ msgid "New Contact"
msgstr "Nou contacte" msgstr "Nou contacte"
#: web/template/contacts/new.gohtml:10 web/template/contacts/index.gohtml:2 #: web/template/contacts/new.gohtml:10 web/template/contacts/index.gohtml:2
#: web/template/contacts/index.gohtml:10 web/template/contacts/edit.gohtml:10 #: web/template/contacts/index.gohtml:10 web/template/contacts/edit.gohtml:11
msgctxt "title" msgctxt "title"
msgid "Contacts" msgid "Contacts"
msgstr "Contactes" msgstr "Contactes"
#: web/template/contacts/new.gohtml:35 web/template/contacts/index.gohtml:14 #: web/template/contacts/new.gohtml:36 web/template/contacts/index.gohtml:15
msgctxt "action" msgctxt "action"
msgid "New contact" msgid "New contact"
msgstr "Nou contacte" msgstr "Nou contacte"
#: web/template/contacts/index.gohtml:24 #: web/template/contacts/index.gohtml:25
msgctxt "contact" msgctxt "contact"
msgid "All" msgid "All"
msgstr "Tots" msgstr "Tots"
#: web/template/contacts/index.gohtml:26 #: web/template/contacts/index.gohtml:27
msgctxt "title" msgctxt "title"
msgid "Email" msgid "Email"
msgstr "Correu-e" msgstr "Correu-e"
#: web/template/contacts/index.gohtml:27 #: web/template/contacts/index.gohtml:28
msgctxt "title" msgctxt "title"
msgid "Phone" msgid "Phone"
msgstr "Telèfon" msgstr "Telèfon"
#: web/template/contacts/index.gohtml:42 #: web/template/contacts/index.gohtml:50
msgid "No contacts added yet." msgid "No contacts added yet."
msgstr "No hi ha cap contacte." msgstr "No hi ha cap contacte."
#: web/template/contacts/edit.gohtml:2 web/template/contacts/edit.gohtml:19 #: web/template/contacts/edit.gohtml:3 web/template/contacts/edit.gohtml:20
msgctxt "title" msgctxt "title"
msgid "Edit Contact “%s”" msgid "Edit Contact “%s”"
msgstr "Edició del contacte «%s»" msgstr "Edició del contacte «%s»"
#: web/template/contacts/edit.gohtml:37 #: web/template/contacts/edit.gohtml:41
msgctxt "action" msgctxt "action"
msgid "Update contact" msgid "Update contact"
msgstr "Actualitza contacte" msgstr "Actualitza contacte"
@ -404,27 +405,27 @@ msgid "New Product"
msgstr "Nou producte" msgstr "Nou producte"
#: web/template/products/new.gohtml:10 web/template/products/index.gohtml:2 #: web/template/products/new.gohtml:10 web/template/products/index.gohtml:2
#: web/template/products/index.gohtml:10 web/template/products/edit.gohtml:10 #: web/template/products/index.gohtml:10 web/template/products/edit.gohtml:11
msgctxt "title" msgctxt "title"
msgid "Products" msgid "Products"
msgstr "Productes" msgstr "Productes"
#: web/template/products/new.gohtml:29 web/template/products/index.gohtml:14 #: web/template/products/new.gohtml:32 web/template/products/index.gohtml:15
msgctxt "action" msgctxt "action"
msgid "New product" msgid "New product"
msgstr "Nou producte" msgstr "Nou producte"
#: web/template/products/edit.gohtml:2 web/template/products/edit.gohtml:19 #: web/template/products/edit.gohtml:3 web/template/products/edit.gohtml:20
msgctxt "title" msgctxt "title"
msgid "Edit Product “%s”" msgid "Edit Product “%s”"
msgstr "Edició del producte «%s»" msgstr "Edició del producte «%s»"
#: web/template/products/edit.gohtml:30 #: web/template/products/edit.gohtml:36
msgctxt "action" 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:172 #: pkg/login.go:36 pkg/profile.go:40 pkg/contacts.go:216
msgctxt "input" msgctxt "input"
msgid "Email" msgid "Email"
msgstr "Correu-e" msgstr "Correu-e"
@ -434,11 +435,11 @@ msgctxt "input"
msgid "Password" msgid "Password"
msgstr "Contrasenya" msgstr "Contrasenya"
#: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:263 #: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:312
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:264 #: pkg/login.go:70 pkg/profile.go:90 pkg/contacts.go:313
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."
@ -450,43 +451,48 @@ 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:165 pkg/invoices.go:647 #: pkg/products.go:209 pkg/invoices.go:636
msgctxt "input" msgctxt "input"
msgid "Name" msgid "Name"
msgstr "Nom" msgstr "Nom"
#: pkg/products.go:171 pkg/invoices.go:652 #: pkg/products.go:215 pkg/invoices.go:641
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripció" msgstr "Descripció"
#: pkg/products.go:176 pkg/invoices.go:656 #: pkg/products.go:220 pkg/invoices.go:645
msgctxt "input" msgctxt "input"
msgid "Price" msgid "Price"
msgstr "Preu" msgstr "Preu"
#: pkg/products.go:186 pkg/invoices.go:682 #: pkg/products.go:230 pkg/invoices.go:671
msgctxt "input" msgctxt "input"
msgid "Taxes" msgid "Taxes"
msgstr "Imposts" msgstr "Imposts"
#: pkg/products.go:206 pkg/profile.go:92 pkg/invoices.go:721 #: pkg/products.go:236 pkg/invoices.go:479 pkg/contacts.go:273
msgctxt "input"
msgid "Tags"
msgstr "Etiquetes"
#: pkg/products.go:255 pkg/profile.go:92 pkg/invoices.go:710
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:207 pkg/invoices.go:722 #: pkg/products.go:256 pkg/invoices.go:711
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:208 pkg/invoices.go:723 #: pkg/products.go:257 pkg/invoices.go:712
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:210 pkg/invoices.go:731 #: pkg/products.go:259 pkg/invoices.go:720
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:211 pkg/invoices.go:732 #: pkg/products.go:260 pkg/invoices.go:721
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."
@ -594,203 +600,198 @@ 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:303 #: pkg/invoices.go:302
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:402 #: pkg/invoices.go:401
msgid "invoices.zip" msgid "invoices.zip"
msgstr "factures.zip" msgstr "factures.zip"
#: pkg/invoices.go:408 pkg/invoices.go:840 #: pkg/invoices.go:407 pkg/invoices.go:829
msgid "Invalid action" msgid "Invalid action"
msgstr "Acció invàlida." msgstr "Acció invàlida."
#: pkg/invoices.go:452 #: pkg/invoices.go:451
msgctxt "input" msgctxt "input"
msgid "Invoice Status" msgid "Invoice Status"
msgstr "Estat de la factura" msgstr "Estat de la factura"
#: pkg/invoices.go:458 #: pkg/invoices.go:457
msgctxt "input" msgctxt "input"
msgid "Customer" msgid "Customer"
msgstr "Client" msgstr "Client"
#: pkg/invoices.go:464 #: pkg/invoices.go:463
msgctxt "input" msgctxt "input"
msgid "Number" msgid "Number"
msgstr "Número" msgstr "Número"
#: pkg/invoices.go:469 #: pkg/invoices.go:468
msgctxt "input" msgctxt "input"
msgid "Invoice Date" msgid "Invoice Date"
msgstr "Data de factura" msgstr "Data de factura"
#: pkg/invoices.go:475 #: pkg/invoices.go:474
msgctxt "input" msgctxt "input"
msgid "Notes" msgid "Notes"
msgstr "Notes" msgstr "Notes"
#: pkg/invoices.go:480 #: pkg/invoices.go:484
msgctxt "input"
msgid "Tags"
msgstr "Etiquetes"
#: pkg/invoices.go:486
msgctxt "input" msgctxt "input"
msgid "Payment Method" msgid "Payment Method"
msgstr "Mètode de pagament" msgstr "Mètode de pagament"
#: pkg/invoices.go:523 #: pkg/invoices.go:521
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:524 #: pkg/invoices.go:522
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:525 #: pkg/invoices.go:523
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:526 #: pkg/invoices.go:524
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:528 #: pkg/invoices.go:526
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."
#: pkg/invoices.go:637 pkg/invoices.go:642 #: pkg/invoices.go:626 pkg/invoices.go:631
msgctxt "input" msgctxt "input"
msgid "Id" msgid "Id"
msgstr "Identificador" msgstr "Identificador"
#: pkg/invoices.go:665 #: pkg/invoices.go:654
msgctxt "input" msgctxt "input"
msgid "Quantity" msgid "Quantity"
msgstr "Quantitat" msgstr "Quantitat"
#: pkg/invoices.go:673 #: pkg/invoices.go:662
msgctxt "input" msgctxt "input"
msgid "Discount (%)" msgid "Discount (%)"
msgstr "Descompte (%)" msgstr "Descompte (%)"
#: pkg/invoices.go:720 #: pkg/invoices.go:709
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."
#: pkg/invoices.go:725 #: pkg/invoices.go:714
msgid "Quantity can not be empty." msgid "Quantity can not be empty."
msgstr "No podeu deixar la quantitat en blanc." msgstr "No podeu deixar la quantitat en blanc."
#: pkg/invoices.go:726 #: pkg/invoices.go:715
msgid "Quantity must be a number greater than zero." msgid "Quantity must be a number greater than zero."
msgstr "La quantitat ha de ser un número major a zero." msgstr "La quantitat ha de ser un número major a zero."
#: pkg/invoices.go:728 #: pkg/invoices.go:717
msgid "Discount can not be empty." msgid "Discount can not be empty."
msgstr "No podeu deixar el descompte en blanc." msgstr "No podeu deixar el descompte en blanc."
#: pkg/invoices.go:729 #: pkg/invoices.go:718
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:143 #: pkg/contacts.go:187
msgctxt "input" msgctxt "input"
msgid "Business name" msgid "Business name"
msgstr "Nom i cognoms" msgstr "Nom i cognoms"
#: pkg/contacts.go:152 #: pkg/contacts.go:196
msgctxt "input" msgctxt "input"
msgid "VAT number" msgid "VAT number"
msgstr "DNI / NIF" msgstr "DNI / NIF"
#: pkg/contacts.go:158 #: pkg/contacts.go:202
msgctxt "input" msgctxt "input"
msgid "Trade name" msgid "Trade name"
msgstr "Nom comercial" msgstr "Nom comercial"
#: pkg/contacts.go:163 #: pkg/contacts.go:207
msgctxt "input" msgctxt "input"
msgid "Phone" msgid "Phone"
msgstr "Telèfon" msgstr "Telèfon"
#: pkg/contacts.go:181 #: pkg/contacts.go:225
msgctxt "input" msgctxt "input"
msgid "Web" msgid "Web"
msgstr "Web" msgstr "Web"
#: pkg/contacts.go:189 #: pkg/contacts.go:233
msgctxt "input" msgctxt "input"
msgid "Address" msgid "Address"
msgstr "Adreça" msgstr "Adreça"
#: pkg/contacts.go:198 #: pkg/contacts.go:242
msgctxt "input" msgctxt "input"
msgid "City" msgid "City"
msgstr "Població" msgstr "Població"
#: pkg/contacts.go:204 #: pkg/contacts.go:248
msgctxt "input" msgctxt "input"
msgid "Province" msgid "Province"
msgstr "Província" msgstr "Província"
#: pkg/contacts.go:210 #: pkg/contacts.go:254
msgctxt "input" msgctxt "input"
msgid "Postal code" msgid "Postal code"
msgstr "Codi postal" msgstr "Codi postal"
#: pkg/contacts.go:219 #: pkg/contacts.go:263
msgctxt "input" msgctxt "input"
msgid "Country" msgid "Country"
msgstr "País" msgstr "País"
#: pkg/contacts.go:252 #: pkg/contacts.go:301
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:256 #: pkg/contacts.go:305
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:257 #: pkg/contacts.go:306
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:258 #: pkg/contacts.go:307
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:260 #: pkg/contacts.go:309
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:261 #: pkg/contacts.go:310
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:267 #: pkg/contacts.go:316
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:269 #: pkg/contacts.go:318
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:270 #: pkg/contacts.go:319
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:271 #: pkg/contacts.go:320
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:272 #: pkg/contacts.go:321
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:273 #: pkg/contacts.go:322
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."

179
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-21 11:56+0100\n" "POT-Creation-Date: 2023-03-27 09:43+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"
@ -26,10 +26,10 @@ msgstr "Añadir productos a la factura"
#: web/template/invoices/products.gohtml:9 web/template/invoices/new.gohtml:9 #: web/template/invoices/products.gohtml:9 web/template/invoices/new.gohtml:9
#: web/template/invoices/index.gohtml:9 web/template/invoices/view.gohtml:9 #: web/template/invoices/index.gohtml:9 web/template/invoices/view.gohtml:9
#: web/template/invoices/edit.gohtml:9 web/template/contacts/new.gohtml:9 #: web/template/invoices/edit.gohtml:9 web/template/contacts/new.gohtml:9
#: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:9 #: web/template/contacts/index.gohtml:9 web/template/contacts/edit.gohtml:10
#: web/template/profile.gohtml:9 web/template/tax-details.gohtml:9 #: web/template/profile.gohtml:9 web/template/tax-details.gohtml:9
#: web/template/products/new.gohtml:9 web/template/products/index.gohtml:9 #: web/template/products/new.gohtml:9 web/template/products/index.gohtml:9
#: web/template/products/edit.gohtml:9 #: web/template/products/edit.gohtml:10
msgctxt "title" msgctxt "title"
msgid "Home" msgid "Home"
msgstr "Inicio" msgstr "Inicio"
@ -48,25 +48,25 @@ msgid "New Invoice"
msgstr "Nueva factura" msgstr "Nueva factura"
#: web/template/invoices/products.gohtml:51 #: web/template/invoices/products.gohtml:51
#: web/template/products/index.gohtml:24 #: 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:52
#: web/template/products/index.gohtml:25 #: 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:53
#: web/template/invoices/view.gohtml:59 web/template/products/index.gohtml:26 #: web/template/invoices/view.gohtml:59 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:67
#: web/template/products/index.gohtml:40 #: web/template/products/index.gohtml:48
msgid "No products added yet." msgid "No products added yet."
msgstr "No hay productos." msgstr "No hay productos."
@ -118,7 +118,7 @@ msgctxt "title"
msgid "Invoice Num." msgid "Invoice Num."
msgstr "Nº factura" msgstr "Nº factura"
#: web/template/invoices/index.gohtml:34 web/template/contacts/index.gohtml:25 #: web/template/invoices/index.gohtml:34 web/template/contacts/index.gohtml:26
msgctxt "title" msgctxt "title"
msgid "Customer" msgid "Customer"
msgstr "Cliente" msgstr "Cliente"
@ -128,7 +128,8 @@ msgctxt "title"
msgid "Status" msgid "Status"
msgstr "Estado" msgstr "Estado"
#: web/template/invoices/index.gohtml:36 #: web/template/invoices/index.gohtml:36 web/template/contacts/index.gohtml:29
#: web/template/products/index.gohtml:27
msgctxt "title" msgctxt "title"
msgid "Tags" msgid "Tags"
msgstr "Etiquetes" msgstr "Etiquetes"
@ -212,37 +213,37 @@ msgctxt "title"
msgid "Dashboard" msgid "Dashboard"
msgstr "Panel" msgstr "Panel"
#: web/template/app.gohtml:22 #: web/template/app.gohtml:23
msgctxt "menu" msgctxt "menu"
msgid "Account" msgid "Account"
msgstr "Cuenta" msgstr "Cuenta"
#: web/template/app.gohtml:28 #: web/template/app.gohtml:29
msgctxt "menu" msgctxt "menu"
msgid "Tax Details" msgid "Tax Details"
msgstr "Configuración fiscal" msgstr "Configuración fiscal"
#: web/template/app.gohtml:36 #: web/template/app.gohtml:37
msgctxt "action" msgctxt "action"
msgid "Logout" msgid "Logout"
msgstr "Salir" msgstr "Salir"
#: web/template/app.gohtml:45 #: web/template/app.gohtml:46
msgctxt "nav" msgctxt "nav"
msgid "Dashboard" msgid "Dashboard"
msgstr "Panel" msgstr "Panel"
#: web/template/app.gohtml:46 #: web/template/app.gohtml:47
msgctxt "nav" msgctxt "nav"
msgid "Invoices" msgid "Invoices"
msgstr "Facturas" msgstr "Facturas"
#: web/template/app.gohtml:47 #: web/template/app.gohtml:48
msgctxt "nav" msgctxt "nav"
msgid "Products" msgid "Products"
msgstr "Productos" msgstr "Productos"
#: web/template/app.gohtml:48 #: web/template/app.gohtml:49
msgctxt "nav" msgctxt "nav"
msgid "Contacts" msgid "Contacts"
msgstr "Contactos" msgstr "Contactos"
@ -254,41 +255,41 @@ msgid "New Contact"
msgstr "Nuevo contacto" msgstr "Nuevo contacto"
#: web/template/contacts/new.gohtml:10 web/template/contacts/index.gohtml:2 #: web/template/contacts/new.gohtml:10 web/template/contacts/index.gohtml:2
#: web/template/contacts/index.gohtml:10 web/template/contacts/edit.gohtml:10 #: web/template/contacts/index.gohtml:10 web/template/contacts/edit.gohtml:11
msgctxt "title" msgctxt "title"
msgid "Contacts" msgid "Contacts"
msgstr "Contactos" msgstr "Contactos"
#: web/template/contacts/new.gohtml:35 web/template/contacts/index.gohtml:14 #: web/template/contacts/new.gohtml:36 web/template/contacts/index.gohtml:15
msgctxt "action" msgctxt "action"
msgid "New contact" msgid "New contact"
msgstr "Nuevo contacto" msgstr "Nuevo contacto"
#: web/template/contacts/index.gohtml:24 #: web/template/contacts/index.gohtml:25
msgctxt "contact" msgctxt "contact"
msgid "All" msgid "All"
msgstr "Todos" msgstr "Todos"
#: web/template/contacts/index.gohtml:26 #: web/template/contacts/index.gohtml:27
msgctxt "title" msgctxt "title"
msgid "Email" msgid "Email"
msgstr "Correo-e" msgstr "Correo-e"
#: web/template/contacts/index.gohtml:27 #: web/template/contacts/index.gohtml:28
msgctxt "title" msgctxt "title"
msgid "Phone" msgid "Phone"
msgstr "Teléfono" msgstr "Teléfono"
#: web/template/contacts/index.gohtml:42 #: web/template/contacts/index.gohtml:50
msgid "No contacts added yet." msgid "No contacts added yet."
msgstr "No hay contactos." msgstr "No hay contactos."
#: web/template/contacts/edit.gohtml:2 web/template/contacts/edit.gohtml:19 #: web/template/contacts/edit.gohtml:3 web/template/contacts/edit.gohtml:20
msgctxt "title" msgctxt "title"
msgid "Edit Contact “%s”" msgid "Edit Contact “%s”"
msgstr "Edición del contacto «%s»" msgstr "Edición del contacto «%s»"
#: web/template/contacts/edit.gohtml:37 #: web/template/contacts/edit.gohtml:41
msgctxt "action" msgctxt "action"
msgid "Update contact" msgid "Update contact"
msgstr "Actualizar contacto" msgstr "Actualizar contacto"
@ -404,27 +405,27 @@ msgid "New Product"
msgstr "Nuevo producto" msgstr "Nuevo producto"
#: web/template/products/new.gohtml:10 web/template/products/index.gohtml:2 #: web/template/products/new.gohtml:10 web/template/products/index.gohtml:2
#: web/template/products/index.gohtml:10 web/template/products/edit.gohtml:10 #: web/template/products/index.gohtml:10 web/template/products/edit.gohtml:11
msgctxt "title" msgctxt "title"
msgid "Products" msgid "Products"
msgstr "Productos" msgstr "Productos"
#: web/template/products/new.gohtml:29 web/template/products/index.gohtml:14 #: web/template/products/new.gohtml:32 web/template/products/index.gohtml:15
msgctxt "action" msgctxt "action"
msgid "New product" msgid "New product"
msgstr "Nuevo producto" msgstr "Nuevo producto"
#: web/template/products/edit.gohtml:2 web/template/products/edit.gohtml:19 #: web/template/products/edit.gohtml:3 web/template/products/edit.gohtml:20
msgctxt "title" msgctxt "title"
msgid "Edit Product “%s”" msgid "Edit Product “%s”"
msgstr "Edición del producto «%s»" msgstr "Edición del producto «%s»"
#: web/template/products/edit.gohtml:30 #: web/template/products/edit.gohtml:36
msgctxt "action" 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:172 #: pkg/login.go:36 pkg/profile.go:40 pkg/contacts.go:216
msgctxt "input" msgctxt "input"
msgid "Email" msgid "Email"
msgstr "Correo-e" msgstr "Correo-e"
@ -434,11 +435,11 @@ msgctxt "input"
msgid "Password" msgid "Password"
msgstr "Contraseña" msgstr "Contraseña"
#: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:263 #: pkg/login.go:69 pkg/profile.go:89 pkg/contacts.go:312
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:264 #: pkg/login.go:70 pkg/profile.go:90 pkg/contacts.go:313
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."
@ -450,43 +451,48 @@ 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:165 pkg/invoices.go:647 #: pkg/products.go:209 pkg/invoices.go:636
msgctxt "input" msgctxt "input"
msgid "Name" msgid "Name"
msgstr "Nombre" msgstr "Nombre"
#: pkg/products.go:171 pkg/invoices.go:652 #: pkg/products.go:215 pkg/invoices.go:641
msgctxt "input" msgctxt "input"
msgid "Description" msgid "Description"
msgstr "Descripción" msgstr "Descripción"
#: pkg/products.go:176 pkg/invoices.go:656 #: pkg/products.go:220 pkg/invoices.go:645
msgctxt "input" msgctxt "input"
msgid "Price" msgid "Price"
msgstr "Precio" msgstr "Precio"
#: pkg/products.go:186 pkg/invoices.go:682 #: pkg/products.go:230 pkg/invoices.go:671
msgctxt "input" msgctxt "input"
msgid "Taxes" msgid "Taxes"
msgstr "Impuestos" msgstr "Impuestos"
#: pkg/products.go:206 pkg/profile.go:92 pkg/invoices.go:721 #: pkg/products.go:236 pkg/invoices.go:479 pkg/contacts.go:273
msgctxt "input"
msgid "Tags"
msgstr "Etiquetes"
#: pkg/products.go:255 pkg/profile.go:92 pkg/invoices.go:710
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:207 pkg/invoices.go:722 #: pkg/products.go:256 pkg/invoices.go:711
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:208 pkg/invoices.go:723 #: pkg/products.go:257 pkg/invoices.go:712
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:210 pkg/invoices.go:731 #: pkg/products.go:259 pkg/invoices.go:720
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:211 pkg/invoices.go:732 #: pkg/products.go:260 pkg/invoices.go:721
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."
@ -594,203 +600,198 @@ 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:303 #: pkg/invoices.go:302
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:402 #: pkg/invoices.go:401
msgid "invoices.zip" msgid "invoices.zip"
msgstr "facturas.zip" msgstr "facturas.zip"
#: pkg/invoices.go:408 pkg/invoices.go:840 #: pkg/invoices.go:407 pkg/invoices.go:829
msgid "Invalid action" msgid "Invalid action"
msgstr "Acción inválida." msgstr "Acción inválida."
#: pkg/invoices.go:452 #: pkg/invoices.go:451
msgctxt "input" msgctxt "input"
msgid "Invoice Status" msgid "Invoice Status"
msgstr "Estado de la factura" msgstr "Estado de la factura"
#: pkg/invoices.go:458 #: pkg/invoices.go:457
msgctxt "input" msgctxt "input"
msgid "Customer" msgid "Customer"
msgstr "Cliente" msgstr "Cliente"
#: pkg/invoices.go:464 #: pkg/invoices.go:463
msgctxt "input" msgctxt "input"
msgid "Number" msgid "Number"
msgstr "Número" msgstr "Número"
#: pkg/invoices.go:469 #: pkg/invoices.go:468
msgctxt "input" msgctxt "input"
msgid "Invoice Date" msgid "Invoice Date"
msgstr "Fecha de factura" msgstr "Fecha de factura"
#: pkg/invoices.go:475 #: pkg/invoices.go:474
msgctxt "input" msgctxt "input"
msgid "Notes" msgid "Notes"
msgstr "Notas" msgstr "Notas"
#: pkg/invoices.go:480 #: pkg/invoices.go:484
msgctxt "input"
msgid "Tags"
msgstr "Etiquetes"
#: pkg/invoices.go:486
msgctxt "input" msgctxt "input"
msgid "Payment Method" msgid "Payment Method"
msgstr "Método de pago" msgstr "Método de pago"
#: pkg/invoices.go:523 #: pkg/invoices.go:521
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:524 #: pkg/invoices.go:522
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:525 #: pkg/invoices.go:523
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:526 #: pkg/invoices.go:524
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:528 #: pkg/invoices.go:526
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."
#: pkg/invoices.go:637 pkg/invoices.go:642 #: pkg/invoices.go:626 pkg/invoices.go:631
msgctxt "input" msgctxt "input"
msgid "Id" msgid "Id"
msgstr "Identificador" msgstr "Identificador"
#: pkg/invoices.go:665 #: pkg/invoices.go:654
msgctxt "input" msgctxt "input"
msgid "Quantity" msgid "Quantity"
msgstr "Cantidad" msgstr "Cantidad"
#: pkg/invoices.go:673 #: pkg/invoices.go:662
msgctxt "input" msgctxt "input"
msgid "Discount (%)" msgid "Discount (%)"
msgstr "Descuento (%)" msgstr "Descuento (%)"
#: pkg/invoices.go:720 #: pkg/invoices.go:709
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."
#: pkg/invoices.go:725 #: pkg/invoices.go:714
msgid "Quantity can not be empty." msgid "Quantity can not be empty."
msgstr "No podéis dejar la cantidad en blanco." msgstr "No podéis dejar la cantidad en blanco."
#: pkg/invoices.go:726 #: pkg/invoices.go:715
msgid "Quantity must be a number greater than zero." msgid "Quantity must be a number greater than zero."
msgstr "La cantidad tiene que ser un número mayor a cero." msgstr "La cantidad tiene que ser un número mayor a cero."
#: pkg/invoices.go:728 #: pkg/invoices.go:717
msgid "Discount can not be empty." msgid "Discount can not be empty."
msgstr "No podéis dejar el descuento en blanco." msgstr "No podéis dejar el descuento en blanco."
#: pkg/invoices.go:729 #: pkg/invoices.go:718
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:143 #: pkg/contacts.go:187
msgctxt "input" msgctxt "input"
msgid "Business name" msgid "Business name"
msgstr "Nombre y apellidos" msgstr "Nombre y apellidos"
#: pkg/contacts.go:152 #: pkg/contacts.go:196
msgctxt "input" msgctxt "input"
msgid "VAT number" msgid "VAT number"
msgstr "DNI / NIF" msgstr "DNI / NIF"
#: pkg/contacts.go:158 #: pkg/contacts.go:202
msgctxt "input" msgctxt "input"
msgid "Trade name" msgid "Trade name"
msgstr "Nombre comercial" msgstr "Nombre comercial"
#: pkg/contacts.go:163 #: pkg/contacts.go:207
msgctxt "input" msgctxt "input"
msgid "Phone" msgid "Phone"
msgstr "Teléfono" msgstr "Teléfono"
#: pkg/contacts.go:181 #: pkg/contacts.go:225
msgctxt "input" msgctxt "input"
msgid "Web" msgid "Web"
msgstr "Web" msgstr "Web"
#: pkg/contacts.go:189 #: pkg/contacts.go:233
msgctxt "input" msgctxt "input"
msgid "Address" msgid "Address"
msgstr "Dirección" msgstr "Dirección"
#: pkg/contacts.go:198 #: pkg/contacts.go:242
msgctxt "input" msgctxt "input"
msgid "City" msgid "City"
msgstr "Población" msgstr "Población"
#: pkg/contacts.go:204 #: pkg/contacts.go:248
msgctxt "input" msgctxt "input"
msgid "Province" msgid "Province"
msgstr "Provincia" msgstr "Provincia"
#: pkg/contacts.go:210 #: pkg/contacts.go:254
msgctxt "input" msgctxt "input"
msgid "Postal code" msgid "Postal code"
msgstr "Código postal" msgstr "Código postal"
#: pkg/contacts.go:219 #: pkg/contacts.go:263
msgctxt "input" msgctxt "input"
msgid "Country" msgid "Country"
msgstr "País" msgstr "País"
#: pkg/contacts.go:252 #: pkg/contacts.go:301
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:256 #: pkg/contacts.go:305
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:257 #: pkg/contacts.go:306
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:258 #: pkg/contacts.go:307
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:260 #: pkg/contacts.go:309
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:261 #: pkg/contacts.go:310
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:267 #: pkg/contacts.go:316
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:269 #: pkg/contacts.go:318
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:270 #: pkg/contacts.go:319
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:271 #: pkg/contacts.go:320
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:272 #: pkg/contacts.go:321
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:273 #: pkg/contacts.go:322
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."

View File

@ -29,18 +29,18 @@
<th>{{( pgettext "Tags" "title" )}}</th> <th>{{( pgettext "Tags" "title" )}}</th>
</tr> </tr>
</thead> </thead>
<tbody data-hx-push-url="false" data-hx-swap="beforeend"> <tbody>
{{ with .Contacts }} {{ with .Contacts }}
{{- range $contact := . }} {{- range $contact := . }}
<tr> <tr>
<td></td> <td></td>
<td><a href="{{ companyURI "/contacts/"}}{{ .Slug }}" data-hx-boost="true">{{ .Name }}</a></td> <td><a href="{{ companyURI "/contacts/"}}{{ .Slug }}" data-hx-push-url="false" data-hx-swap="beforeend" 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>
{{- range $index, $tag := .Tags }} {{- range $index, $tag := .Tags }}
{{- if gt $index 0 }}, {{ end -}} {{- if gt $index 0 }}, {{ end -}}
<a href="?tag={{ . }}">{{ . }}</a> <a href="?tag={{ . }}" data-hx-target="main" data-hx-boost="true">{{ . }}</a>
{{- end }} {{- end }}
</td> </td>
</tr> </tr>

View File

@ -1,31 +1,36 @@
{{ define "title" -}} {{ define "title" -}}
{{printf (pgettext "Edit Product “%s”" "title") .Name }} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.editProductPage*/ -}}
{{printf (pgettext "Edit Product “%s”" "title") .ProductName }}
{{- end }} {{- end }}
{{ define "breadcrumbs" -}} {{ define "breadcrumbs" -}}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.productForm*/ -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.editProductPage*/ -}}
<nav> <nav>
<p> <p>
<a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> / <a href="{{ companyURI "/" }}">{{( pgettext "Home" "title" )}}</a> /
<a href="{{ companyURI "/products"}}">{{( pgettext "Products" "title" )}}</a> / <a href="{{ companyURI "/products"}}">{{( pgettext "Products" "title" )}}</a> /
<a>{{ .Name }}</a> <a>{{ .ProductName }}</a>
</p> </p>
</nav> </nav>
{{- end }} {{- end }}
{{ define "content" }} {{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.productForm*/ -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.editProductPage*/ -}}
<section class="dialog-content"> <section class="dialog-content" id="edit-product-dialog-content" data-hx-target="this">
<h2>{{printf (pgettext "Edit Product “%s”" "title") .Name }}</h2> <h2>{{printf (pgettext "Edit Product “%s”" "title") .ProductName }}</h2>
<form method="POST"> <form method="POST" action="{{ companyURI "/products/" }}{{ .Slug }}"
data-hx-boost="true" data-hx-select="#edit-product-dialog-content"
>
{{ csrfToken }} {{ csrfToken }}
{{ putMethod }} {{ putMethod }}
{{ with .Form }}
{{ template "input-field" .Name | addInputAttr "autofocus" }} {{ template "input-field" .Name | addInputAttr "autofocus" }}
{{ template "input-field" .Description }} {{ template "input-field" .Description }}
{{ template "input-field" .Price }} {{ template "input-field" .Price }}
{{ template "select-field" .Tax }} {{ template "select-field" .Tax }}
{{ template "tags-field" .Tags }} {{ template "tags-field" .Tags }}
{{ end }}
<fieldset> <fieldset>
<button class="primary" type="submit">{{( pgettext "Update product" "action" )}}</button> <button class="primary" type="submit">{{( pgettext "Update product" "action" )}}</button>

View File

@ -11,6 +11,7 @@
</p> </p>
<p> <p>
<a class="primary button" <a class="primary button"
data-hx-push-url="false" data-hx-swap="beforeend" data-hx-boost="true"
href="{{ companyURI "/products/new" }}">{{( pgettext "New product" "action" )}}</a> href="{{ companyURI "/products/new" }}">{{( pgettext "New product" "action" )}}</a>
</p> </p>
</nav> </nav>
@ -32,11 +33,11 @@
{{- range $product := . }} {{- range $product := . }}
<tr> <tr>
<td></td> <td></td>
<td><a href="{{ companyURI "/products/"}}{{ .Slug }}">{{ .Name }}</a></td> <td><a href="{{ companyURI "/products/"}}{{ .Slug }}" data-hx-push-url="false" data-hx-swap="beforeend" data-hx-boost="true">{{ .Name }}</a></td>
<td> <td>
{{- range $index, $tag := .Tags }} {{- range $index, $tag := .Tags }}
{{- if gt $index 0 }}, {{ end -}} {{- if gt $index 0 }}, {{ end -}}
<a href="?tag={{ . }}">{{ . }}</a> <a href="?tag={{ . }}" data-hx-target="main" data-hx-boost="true">{{ . }}</a>
{{- end }} {{- end }}
</td> </td>
<td class="numeric">{{ .Price | formatPrice }}</td> <td class="numeric">{{ .Price | formatPrice }}</td>

View File

@ -15,9 +15,11 @@
{{ define "content" }} {{ define "content" }}
{{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.productForm*/ -}} {{- /*gotype: dev.tandem.ws/tandem/numerus/pkg.productForm*/ -}}
<section class="dialog-content"> <section class="dialog-content" id="new-product-dialog-content" data-hx-target="this">
<h2>{{(pgettext "New Product" "title")}}</h2> <h2>{{(pgettext "New Product" "title")}}</h2>
<form method="POST" action="{{ companyURI "/products" }}"> <form method="POST" action="{{ companyURI "/products" }}"
data-hx-boost="true" data-hx-select="#new-product-dialog-content"
>
{{ csrfToken }} {{ csrfToken }}
{{ template "input-field" .Name | addInputAttr "autofocus" }} {{ template "input-field" .Name | addInputAttr "autofocus" }}