Commit Graph

71 Commits

Author SHA1 Message Date
taitus
87fc3c572b Add security secret "last_sign_in"
In order to comply with the security measure for the
ENS: "[op.acc.5.r5.2] The user shall be informed of
the last access made with his identity".

We have added a new secret to display the last
access made to the user on the "My account" page.
2023-10-20 08:03:24 +02:00
Javi Martín
517f74a748 Extract component to render an initialjs avatar
This way it'll be easier to change it.
2023-10-10 15:03:35 +02:00
decabeza
e51f240736 Show email digest only if proposals are enabled 2023-05-19 12:41:56 +02:00
Javi Martín
1ecd422f7f Extract component to render verification info
We're also adding tests showing the current behavior, which we're about
to change.
2023-01-04 16:06:29 +01:00
Javi Martín
9b908d7264 Extract component to render account permissions
We were using similar code in four different places; six, if we count
the welcome pages seeds. Reducing duplication in the pages seeds is a
bit tricky because administrators are supposed to edit their content and
might remove the HTML class we use to define styles. However, we can
share the code everywhere else.

Note that there's a bug in the application since we show that level 2
users cannot vote for budget projects but we give them permission to do
so in the abilities model. We're keeping the same behavior after this
refactoring but we might change it in the future.
2022-11-29 18:48:24 +01:00
Javi Martín
92b1e53fc3 Unify user permission texts
We had the same texts four times, with slight variations in the case of
the management section.

We're unifying them under the "verification" i18n namespace, since the
texts are about actions which can be done depending on whether users are
verified or not.

Note the names of the i18n keys aren't very consistent, since we use
"debates" in plural but "proposal" in singular. We're leaving it like
this so existing translations aren't affected.
2022-06-01 14:27:33 +02:00
Javi Martín
67e9c68662 Remove confusing permission info in "my account"
We were saying that actions marked with an asterisk were only possible
when users were verified. However, there were no actions marked with an
asterisk; instead, we didn't show these actions to non-verified users.

Besides, the concept of Census doesn't exist in many CONSUL
installations, where verification is done through other means, so the
text saying that only users on Census could do certain things wasn't
correct in these cases.

Due to that, we're removing the asterisk in the Spanish version as well.
We're also removing the asterisk in the default welcome pages, since
we're already saying which action can't be done until the account is
verified.

In the case of the residence verification page, we had asterisks but we
didn't explain what the asterisk stood for, so we're also removing it.
2022-06-01 14:27:33 +02:00
Javi Martín
ae91361edb Use telephone fields in phone number form controls
Using a field with `type="tel"` causes most mobile phone browsers to
show a numeric keyboard which makes it easy to enter phone numbers.

We aren't using a number field because some browsers show "spinners" to
increment/decrement numbers (which doesn't make much sense in a phone
number) and because they don't allow characters like spaces. Phone
numbers can have characters like spaces, dashes, parenthesis, asterisks,
the plus sign, ...

Since phone number formats vary depending on the region, and sometimes
even within the same region several different formats can be used, for
now we aren't offering any kind of format validation. We could offer a
format validation that rejects just letters (although there are cases
where letters are actually allowed). However, this causes issues at both
the server side and the client side.

We could use a client-side validation adding a `pattern` attribute to
the field, but that would be something unlike anything else we use in
the application, and we would need to to write some JavaScript in order
to use a proper error message.

On the other hand, if we add a server-side validation, we might find out
existing users are invalid, and it would be impossible to update them in
the many places where we update users assuming they were valid in the
first place. We'd have to add a rake task to update existing user
records and make sure they contain a valid phone number or create a
setting so this validation only applies to new CONSUL installations.
Another option would be to add a per-form validation, so the phone
number is only validated in pages where it is introduced.

All the mentioned scenarios offer certain complexities. So, for now,
we're keeping things simple.

Co-Authored-By: decabeza <alberto@decabeza.es>
2021-12-16 13:24:26 +01:00
Javi Martín
1632540984 Remove redundant placeholders in forms
Using placeholders having similar (or identical) text as already present
as a label has a few issues.

First, it's a distraction. Reading the same information twice is
useless, requires an extra effort, and might even frustrate users.

Second, if users start typing before reading the placeholder and see it
disappear, they might think they're missing relevant information,
delete what they typed, and read the placeholder. That will get them
nowhere.

Finally, we display placeholders using a text offering very low contrast
against the background, so users don't think the placeholder is an
actual value entered in the field. Using such low contrast makes the
text hard to read, particularly for users with visual impairments.

So we're removing these placeholders.

This commit only deals with placeholder texts with similar (or
identical) texts as the label text. There might be other places where we
should replace placeholder texts with labels, but that's a different
topic.
2021-06-23 19:52:45 +02:00
Javi Martín
6fa67b5e53 Use active record translations for labels
This way we can simplify the way we generate form fields. In some cases,
we also use the human attribute in table headers, which IMHO makes
sense.

I haven't moved all of them: for example, sometimes a label is
different depending on whether it's shown to administrators, valuators,
or users. And I haven't touched the ones related to devise, since I
wasn't sure about possible side effects.

Note I've also removed placeholders when they had the same text as their
labels, since they weren't helpful. On the contrary, the added redundant
text to the form, potentially distracting users.
2019-10-07 01:56:23 +02:00
Javi Martín
8d9cb4d8e3 Simplify generating checkboxes in forms
Using the block syntax to generate the label with a <span> tag inside
isn't necessary after upgrading foundation_rails_helpers. Before the
upgrade, we couldn't do so because the <span> tag was escaped.
2019-10-06 19:32:04 +02:00
Javi Martín
c62da726b8 Apply SpaceAroundErbTag ERB Lint rule 2019-09-10 20:02:15 +02:00
Javi Martín
488461b8ac Remove consecutive blank lines 2019-09-10 20:02:15 +02:00
Julian Herrero
f6489bc604 Use double quotes in app/views 2019-03-19 12:33:07 +01:00
Angel Perez
054bc1397b Wrap recommendations settings checkboxes with label helper to improve A11y 2018-07-15 21:28:58 -04:00
Angel Perez
a58f6a2662 Enable 'Recommended proposals' setting for users 2018-07-15 21:28:57 -04:00
Angel Perez
522c206f6d Enable 'Recommended debates' setting for users 2018-07-15 21:28:57 -04:00
decabeza
4f3c75c205 changes public interest label and improves account show layout 2017-12-15 18:48:24 +01:00
decabeza
f24b9db8c4 improves styles of change credentials button 2017-07-17 17:22:47 +02:00
taitus
19820e4432 Add public interests validation and show interests on user profile 2017-07-07 13:34:43 +02:00
Juanjo Bazán
315c57929a allows managers to create users without email
allows managers to create users without email

hides email preferences from account page for email-less users

prevents email delivery to users with no email

adds spec for user creation from management

adds specs for user's email requirement

adds spec for no deliveries if no email
2017-06-19 13:02:48 +02:00
rgarcia
51d688897a displays badge option if official position is level 1 2016-06-20 21:37:03 +02:00
rgarcia
98040e191e fixes conflicts with fork 2016-06-20 21:33:34 +02:00
rgarcia
28d12fe55b removes sending individual proposal notifications via email 2016-06-15 10:43:02 +02:00
rgarcia
fd67294075 adds option to receive direct messages 2016-06-14 18:20:36 +02:00
rgarcia
9f19a5d143 adds option to receive email digest 2016-06-14 18:08:27 +02:00
rgarcia
ad697cd2c1 adds preference to receive proposal notifications 2016-06-06 12:55:33 +02:00
Alberto Garcia Cabeza
9dce52a69a Adds title on input checkboxes 2016-03-14 19:32:49 +01:00
Alberto Garcia Cabeza
3ec0971b37 Replaces icons i tags for span 2016-03-14 19:32:48 +01:00
Alberto Garcia Cabeza
3752f3a53b Adds foundation 6 🎉 2016-02-26 19:33:33 +01:00
rgarcia
3faadacc15 differentiates between level 2 and level 3 users 2016-02-04 13:38:56 +01:00
Julian Herrero
b64dc3a7cb Merge branch 'master' of https://github.com/consul/consul 2015-12-24 12:58:51 +01:00
Julian Herrero
2049eb0455 rename column name to newsletter 2015-12-24 12:53:03 +01:00
Julian Herrero
e7314ac380 add option to subscribe/unsubscribe to website newsletter 2015-12-16 16:14:35 +01:00
Alberto Garcia Cabeza
52e5cda45e Improves footer and account page 2015-12-16 13:03:23 +01:00
Juanjo Bazán
3465b00e89 adds 'My activity' link 2015-11-04 13:51:57 +01:00
Alberto Garcia Cabeza
6af6a63e15 Adds new styles for erase account 2015-10-20 12:37:01 +02:00
kikito
9cc158540e implements a first version of the forms. Missing: a) tests and b) check db constraints (duplicate email "", etc) 2015-10-16 20:04:16 +02:00
Alberto Garcia Cabeza
ebcb1009ae Changes texts and styles for verification process 2015-10-02 15:15:05 +02:00
Alberto Garcia Cabeza
de4b0eb502 Improves styles for verification account 2015-09-17 13:38:32 +02:00
Juanjo Bazán
1e96bba262 refactors account's email config 2015-09-14 14:09:24 +02:00
Juanjo Bazán
d8c9974d1a adds responsible_name to org's account page 2015-09-12 18:16:40 +02:00
Juanjo Bazán
d6c52ec866 puts organizations out of verification process 2015-09-12 18:05:51 +02:00
Juanjo Bazán
eb276b917a changes link in account page to verification path 2015-09-11 14:41:51 +02:00
kikito
be2a098706 removes missing constant in views, replacing by class method 2015-09-10 18:14:59 +02:00
kikito
2d3015703d replaces constants by class methods + private functions. Fixes broken tests 2015-09-10 13:02:21 +02:00
kikito
ada03c8474 Adds max lengths in views 2015-09-09 18:34:26 +02:00
Alberto Garcia Cabeza
101a50a96e Improves layout styles 2015-09-07 16:36:33 +02:00
Alberto Garcia Cabeza
e0959f3e28 Improves account checkboxes and edit debate button 2015-09-04 15:07:41 +02:00
Alberto Garcia Cabeza
da86c5d6e0 Adds styles for verification account process 2015-09-02 12:34:08 +02:00