Go to file
jordi fita mas 9f17f55547 Validate profile form and use templates for fields
Let’s start first with a non-fancy validation method with just if
conditionals instead of bringing yet another complicated library.  I
hope i do not regret it.

I wanted to move all the input field to a template because all that
gobbledygook with the .input div and repeating the label in the
placeholder was starting to annoy me.  Now with error messages was even
more concerning.

I did not know whether the label should be a part of the input fields
or something that the template should do.  At the end i decided that
it makes more sense to be part of the input field because in the error
messages i use that same label, thus the template does not have a say
in that, and, besides, it was just easier to write the template.

The same with the error messages: i’ve seen frameworks that have a map
with the field’s id/name to the error slice, but then it would be
a bit harder to write the template.

I added AddError functions instead of just using append inside the
validator function, and have a local variable for whether it all went
OK, because i was worried that i would leave out the `ok = false`
in some conditions.

I had started writing “constructors” functions for InputField and
SelectField, but then had to add other methods to change the required
field and who knows what else, and in the end it was easier to just
construct the field inline.
2023-01-31 15:40:12 +01:00
cmd/numerus Implement login cookie, its verification, and logout 2023-01-17 20:58:13 +01:00
debian Add required PostgreSQL extensions as dependencies for Debian 2023-01-24 23:59:28 +01:00
demo Add the tax relation with very rough form and handler 2023-01-28 14:18:58 +01:00
deploy Add the contact relation and a rough first form 2023-01-29 15:14:31 +01:00
pkg Validate profile form and use templates for fields 2023-01-31 15:40:12 +01:00
po Validate profile form and use templates for fields 2023-01-31 15:40:12 +01:00
revert Add the contact relation and a rough first form 2023-01-29 15:14:31 +01:00
test Add the contact relation and a rough first form 2023-01-29 15:14:31 +01:00
verify Add the contact relation and a rough first form 2023-01-29 15:14:31 +01:00
web Validate profile form and use templates for fields 2023-01-31 15:40:12 +01:00
.gitignore Ignore IntelliJ’s project files 2023-01-30 16:42:15 +01:00
COPYING Rename LICENSE to COPYING 2023-01-15 04:08:35 +01:00
Makefile Rename extension of templates to .gohtml 2023-01-30 16:48:21 +01:00
go.mod Add Catalan and Spanish translation with gotext[3] 2023-01-18 20:26:30 +01:00
go.sum Add Catalan and Spanish translation with gotext[3] 2023-01-18 20:26:30 +01:00
sqitch.conf Setup authentication schema and user relation 2023-01-13 20:30:21 +01:00
sqitch.plan Add the contact relation and a rough first form 2023-01-29 15:14:31 +01:00