From 18b38f593cde8f8021ada7a3edac0e5d99c5c6a8 Mon Sep 17 00:00:00 2001 From: jordi fita mas Date: Fri, 19 Jan 2024 20:03:04 +0100 Subject: [PATCH] =?UTF-8?q?Add=20the=20application=E2=80=99s=20version=20o?= =?UTF-8?q?n=20the=20footer?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This is mostly to reassure people that we are running the same version as published on numerus.cat. Or at least, try. Go 1.18 adds the info from git if the package is build from a git repository, but this is not the case in OBS, so i instead relay on a constant for the version number. This constant is “updated” by Debian’s rules, mostly due to the discussion in [0]. [0]: https://github.com/golang/go/issues/22706 --- debian/rules | 1 + pkg/build.go | 3 ++ pkg/template.go | 3 ++ po/ca.po | 80 ++++++++++++++++++++--------------------- po/es.po | 80 ++++++++++++++++++++--------------------- web/static/numerus.css | 6 ++++ web/template/app.gohtml | 3 ++ 7 files changed, 94 insertions(+), 82 deletions(-) create mode 100644 pkg/build.go diff --git a/debian/rules b/debian/rules index caa8dd0..9b7c14c 100755 --- a/debian/rules +++ b/debian/rules @@ -4,6 +4,7 @@ dh $@ --builddirectory=_build --buildsystem=golang --with=golang execute_before_dh_auto_build: + printf 'package pkg; const Version = "%s"' "$(DEB_UPSTREAM_VERSION)" > pkg/build.go make execute_after_dh_auto_test: diff --git a/pkg/build.go b/pkg/build.go new file mode 100644 index 0000000..e7d7fd0 --- /dev/null +++ b/pkg/build.go @@ -0,0 +1,3 @@ +package pkg + +const Version = "1.1~git" diff --git a/pkg/template.go b/pkg/template.go index a5fdeff..33d0adc 100644 --- a/pkg/template.go +++ b/pkg/template.go @@ -96,6 +96,9 @@ func mustRenderTemplate(wr io.Writer, r *http.Request, layout string, filename s "slugify": func(s string) string { return slugify(s) }, + "numerusVersion": func() string { + return Version + }, }) if _, err := t.ParseFiles(templateFile(filename), templateFile(layout), templateFile("form.gohtml")); err != nil { panic(err) diff --git a/po/ca.po b/po/ca.po index 3be42f0..887dda7 100644 --- a/po/ca.po +++ b/po/ca.po @@ -8,7 +8,7 @@ msgid "" msgstr "" "Project-Id-Version: numerus\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2023-11-06 13:50+0100\n" +"POT-Creation-Date: 2024-01-19 19:57+0100\n" "PO-Revision-Date: 2023-01-18 17:08+0100\n" "Last-Translator: jordi fita mas \n" "Language-Team: Catalan \n" @@ -288,26 +288,6 @@ msgctxt "title" msgid "Edit Invoice “%s”" msgstr "Edició de la factura «%s»" -#: web/template/home.gohtml:9 -msgid "If you want to sign in, just head to %sthe login page%s and enter your credentials in the form." -msgstr "Si vols accedir al teu usuari només has d'anar a %sla pàgina d’entrada%s i apuntar les teves credencials al seu lloc." - -#: web/template/home.gohtml:12 -msgid "manager" -msgstr "gestor" - -#: web/template/home.gohtml:16 -msgid "Tool to simplify management for small business and freelancers" -msgstr "Eina per simplificar la gestió d’autònoms i petites empreses." - -#: web/template/home.gohtml:19 -msgid "Reduce management time, take control of your balance." -msgstr "Redueix el temps de gestió, tingues controlats els teus números." - -#: web/template/home.gohtml:20 -msgid "application" -msgstr "aplicació" - #: web/template/form.gohtml:36 msgctxt "input" msgid "(Max. %s)" @@ -334,32 +314,27 @@ msgctxt "title" msgid "Dashboard" msgstr "Tauler" -#: web/template/dashboard.gohtml:29 -msgctxt "term" -msgid "Sales" -msgstr "Vendes" - -#: web/template/dashboard.gohtml:33 +#: web/template/dashboard.gohtml:31 msgctxt "term" msgid "Income" msgstr "Ingressos" -#: web/template/dashboard.gohtml:37 +#: web/template/dashboard.gohtml:35 msgctxt "term" msgid "Expenses" msgstr "Despeses" -#: web/template/dashboard.gohtml:41 +#: web/template/dashboard.gohtml:39 msgctxt "term" msgid "VAT" msgstr "IVA" -#: web/template/dashboard.gohtml:45 +#: web/template/dashboard.gohtml:43 msgctxt "term" msgid "IRPF" msgstr "IRPF" -#: web/template/dashboard.gohtml:49 +#: web/template/dashboard.gohtml:47 msgctxt "term" msgid "Net Income" msgstr "Ingressos nets" @@ -439,56 +414,60 @@ msgctxt "title" msgid "Edit Quotation “%s”" msgstr "Edició del pressupost «%s»" -#: web/template/app.gohtml:23 +#: web/template/app.gohtml:24 msgctxt "menu" msgid "Account" msgstr "Compte" -#: web/template/app.gohtml:29 +#: web/template/app.gohtml:30 msgctxt "menu" msgid "Tax Details" msgstr "Configuració fiscal" -#: web/template/app.gohtml:35 +#: web/template/app.gohtml:36 msgctxt "menu" msgid "Switch Company" msgstr "Canvi d’empresa" -#: web/template/app.gohtml:43 +#: web/template/app.gohtml:44 msgctxt "action" msgid "Logout" msgstr "Surt" -#: web/template/app.gohtml:52 +#: web/template/app.gohtml:53 msgctxt "nav" msgid "Dashboard" msgstr "Tauler" -#: web/template/app.gohtml:53 +#: web/template/app.gohtml:54 msgctxt "nav" msgid "Quotations" msgstr "Pressuposts" -#: web/template/app.gohtml:54 +#: web/template/app.gohtml:55 msgctxt "nav" msgid "Invoices" msgstr "Factures" -#: web/template/app.gohtml:55 +#: web/template/app.gohtml:56 msgctxt "nav" msgid "Expenses" msgstr "Despeses" -#: web/template/app.gohtml:56 +#: web/template/app.gohtml:57 msgctxt "nav" msgid "Products" msgstr "Productes" -#: web/template/app.gohtml:57 +#: web/template/app.gohtml:58 msgctxt "nav" msgid "Contacts" msgstr "Contactes" +#: web/template/app.gohtml:66 +msgid "Numerus Version: %s" +msgstr "Numerus versió: %s" + #: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11 #: web/template/contacts/new.gohtml:19 msgctxt "title" @@ -1374,6 +1353,25 @@ msgctxt "input" msgid "Holded Excel file" msgstr "Fitxer Excel del Holded" +#~ msgid "If you want to sign in, just head to %sthe login page%s and enter your credentials in the form." +#~ msgstr "Si vols accedir al teu usuari només has d'anar a %sla pàgina d’entrada%s i apuntar les teves credencials al seu lloc." + +#~ msgid "manager" +#~ msgstr "gestor" + +#~ msgid "Tool to simplify management for small business and freelancers" +#~ msgstr "Eina per simplificar la gestió d’autònoms i petites empreses." + +#~ msgid "Reduce management time, take control of your balance." +#~ msgstr "Redueix el temps de gestió, tingues controlats els teus números." + +#~ msgid "application" +#~ msgstr "aplicació" + +#~ msgctxt "term" +#~ msgid "Sales" +#~ msgstr "Vendes" + #~ msgctxt "title" #~ msgid "Switch Company" #~ msgstr "Canvi d’empresa" diff --git a/po/es.po b/po/es.po index dda3302..d8d01d0 100644 --- a/po/es.po +++ b/po/es.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: numerus\n" "Report-Msgid-Bugs-To: jordi@tandem.blog\n" -"POT-Creation-Date: 2023-11-06 13:50+0100\n" +"POT-Creation-Date: 2024-01-19 19:57+0100\n" "PO-Revision-Date: 2023-01-18 17:45+0100\n" "Last-Translator: jordi fita mas \n" "Language-Team: Spanish \n" @@ -288,26 +288,6 @@ msgctxt "title" msgid "Edit Invoice “%s”" msgstr "Edición de la factura «%s»" -#: web/template/home.gohtml:9 -msgid "If you want to sign in, just head to %sthe login page%s and enter your credentials in the form." -msgstr "Si quieres acceder a tu usuario solo tienes que ir a %sla página de entrada% y anotar tus credenciales a su sitio." - -#: web/template/home.gohtml:12 -msgid "manager" -msgstr "gestor" - -#: web/template/home.gohtml:16 -msgid "Tool to simplify management for small business and freelancers" -msgstr "Herramienta para simplificar la gestión de autónomos y pequeñas empresas." - -#: web/template/home.gohtml:19 -msgid "Reduce management time, take control of your balance." -msgstr "Reduce el tiempo de gestión, ten controlados tus números." - -#: web/template/home.gohtml:20 -msgid "application" -msgstr "aplicación" - #: web/template/form.gohtml:36 msgctxt "input" msgid "(Max. %s)" @@ -334,32 +314,27 @@ msgctxt "title" msgid "Dashboard" msgstr "Panel" -#: web/template/dashboard.gohtml:29 -msgctxt "term" -msgid "Sales" -msgstr "Ventas" - -#: web/template/dashboard.gohtml:33 +#: web/template/dashboard.gohtml:31 msgctxt "term" msgid "Income" msgstr "Ingresos" -#: web/template/dashboard.gohtml:37 +#: web/template/dashboard.gohtml:35 msgctxt "term" msgid "Expenses" msgstr "Gastos" -#: web/template/dashboard.gohtml:41 +#: web/template/dashboard.gohtml:39 msgctxt "term" msgid "VAT" msgstr "IVA" -#: web/template/dashboard.gohtml:45 +#: web/template/dashboard.gohtml:43 msgctxt "term" msgid "IRPF" msgstr "IRPF" -#: web/template/dashboard.gohtml:49 +#: web/template/dashboard.gohtml:47 msgctxt "term" msgid "Net Income" msgstr "Ingresos netos" @@ -439,56 +414,60 @@ msgctxt "title" msgid "Edit Quotation “%s”" msgstr "Edición del presupuesto «%s»" -#: web/template/app.gohtml:23 +#: web/template/app.gohtml:24 msgctxt "menu" msgid "Account" msgstr "Cuenta" -#: web/template/app.gohtml:29 +#: web/template/app.gohtml:30 msgctxt "menu" msgid "Tax Details" msgstr "Configuración fiscal" -#: web/template/app.gohtml:35 +#: web/template/app.gohtml:36 msgctxt "menu" msgid "Switch Company" msgstr "Cambio de empresa" -#: web/template/app.gohtml:43 +#: web/template/app.gohtml:44 msgctxt "action" msgid "Logout" msgstr "Salir" -#: web/template/app.gohtml:52 +#: web/template/app.gohtml:53 msgctxt "nav" msgid "Dashboard" msgstr "Panel" -#: web/template/app.gohtml:53 +#: web/template/app.gohtml:54 msgctxt "nav" msgid "Quotations" msgstr "Presupuestos" -#: web/template/app.gohtml:54 +#: web/template/app.gohtml:55 msgctxt "nav" msgid "Invoices" msgstr "Facturas" -#: web/template/app.gohtml:55 +#: web/template/app.gohtml:56 msgctxt "nav" msgid "Expenses" msgstr "Gastos" -#: web/template/app.gohtml:56 +#: web/template/app.gohtml:57 msgctxt "nav" msgid "Products" msgstr "Productos" -#: web/template/app.gohtml:57 +#: web/template/app.gohtml:58 msgctxt "nav" msgid "Contacts" msgstr "Contactos" +#: web/template/app.gohtml:66 +msgid "Numerus Version: %s" +msgstr "Numerus versión: %s" + #: web/template/contacts/new.gohtml:2 web/template/contacts/new.gohtml:11 #: web/template/contacts/new.gohtml:19 msgctxt "title" @@ -1374,6 +1353,25 @@ msgctxt "input" msgid "Holded Excel file" msgstr "Archivo Excel de Holded" +#~ msgid "If you want to sign in, just head to %sthe login page%s and enter your credentials in the form." +#~ msgstr "Si quieres acceder a tu usuario solo tienes que ir a %sla página de entrada% y anotar tus credenciales a su sitio." + +#~ msgid "manager" +#~ msgstr "gestor" + +#~ msgid "Tool to simplify management for small business and freelancers" +#~ msgstr "Herramienta para simplificar la gestión de autónomos y pequeñas empresas." + +#~ msgid "Reduce management time, take control of your balance." +#~ msgstr "Reduce el tiempo de gestión, ten controlados tus números." + +#~ msgid "application" +#~ msgstr "aplicación" + +#~ msgctxt "term" +#~ msgid "Sales" +#~ msgstr "Ventas" + #~ msgctxt "title" #~ msgid "Switch Company" #~ msgstr "Cambio de empresa" diff --git a/web/static/numerus.css b/web/static/numerus.css index 7ed0f39..544acb8 100644 --- a/web/static/numerus.css +++ b/web/static/numerus.css @@ -314,6 +314,12 @@ main { padding: 2rem 3rem; } +body > footer { + border-top: 1px solid var(--numerus--color--light-gray); + font-size: 75%; + padding: .25em 3rem; +} + .input { margin-top: 2rem; flex: 1; diff --git a/web/template/app.gohtml b/web/template/app.gohtml index 62c8f59..b7c401b 100644 --- a/web/template/app.gohtml +++ b/web/template/app.gohtml @@ -62,6 +62,9 @@ {{- template "breadcrumbs" . }} {{- template "content" . }} +
+

{{printf ( gettext "Numerus Version: %s") numerusVersion | unsafe}}

+