Commit Graph

367 Commits

Author SHA1 Message Date
Javi Martín
45c1f93562 Add a link to skip to the main content
While people using screen readers already have keyboard shortcuts to
jump to the <main> tag, there are people who navigate the page with the
keyboard using just the tab key, and for them, this link provides a way
to save time and start reading the main content instead of having to
manually go through all the navigation links every time a new page is
loaded.

Note that we had to add an additional `width: 0` rule because
Foundation's `element-invisible` would apply `1px` and the test checking
for `visible: :hidden` would faile.
2024-03-23 00:35:47 +01:00
Sebastia
c1e0d58291 Merge pull request #5274 from consuldemocracy/last-sign-in
ENS: Add security secret "last_sign_in"
2023-10-24 18:57:18 +02:00
Javi Martín
56d834783c Open links to social networks in the same window
As mentioned in earlier commits, opening external links in a new
tab/window results in usability and accessibility issues.

Since these links are usually at the top or bottom of the page and
contain icons of well-known sites, IMHO there's no need to even notify
people that these are external links.

Since we're no longer using the `shared.target_blank` translation inside
a sentence, we can remove the space and parenthesis in the translations.
2023-10-24 16:41:03 +02:00
Javi Martín
95958b2080 Remove title attribute in fields to accept terms
Not sure why we introduced these titles in commit 9dce52a69. The title
attributes contained the same text as the label, which IMHO made them
useless.
2023-10-23 18:19:48 +02:00
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
21a268ab96 Remove alert for Internet Explorer 8 and below
Internet Explorer 8 was released in 2009 and people using it already
know that most web pages look broken on it, so we don't need to warn
them.

Removing it makes our application layout file much easier to read and
modify.
2023-09-07 19:44:54 +02:00
Javi Martín
629756dd15 Change URLs referencing our GitHub repositories 2023-07-12 16:05:26 +02:00
Javi Martín
ce7b37f6f8 Change name in English and Spanish texts 2023-07-07 15:07:46 +02:00
decabeza
1eb52fb045 Add read more links to poll question component 2022-10-18 11:04:40 +02:00
decabeza
36e452437e Add questions with mutiple answers to polls public interface
The `reload` method added to max_votes validation is needed because the
author gets here with some changes because of the around_action
`switch_locale`, which adds some changes to the current user record and
therefore, the lock method raises an exception when trying to lock it
requiring us to save or discard those record changes.
2022-10-18 11:04:40 +02:00
Julian Herrero
ecd22131f1 Disallow to modify the end date for an ended poll 2022-09-20 17:29:01 +02:00
Julian Herrero
471096c698 Disallow to modify the start date for an already started poll
We need to update a couple of tests because a poll is created in the
tests with a timestamp that includes nanoseconds and in the form to edit
the time of the poll the nanoseconds are not sent, meaning it was
detected as a change.
2022-09-20 17:21:36 +02:00
Julian Herrero
855fedc025 Allow only creation of polls with dates that are not in the past 2022-09-20 13:37:56 +02:00
taitus
2865ee286f Add comments count component
Remove all the translations that are left over after having unified them
in the component.
2022-08-19 15:40:51 +02:00
decabeza
52e65ba031 Add comments count on budget investments 2022-08-02 13:40:48 +02: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
5c0aa42351 Remove duplication in search results summary
We were using very similar code for proposals, debates and investments,
so we might as well share the code between them.

Note we're using the `proposals.index.search_results` key even for
debates and investments. This will still work because the translations
shared the same text, but IMHO we should rename the key to something
like `shared.search_results_summary`. We aren't doing so because we'd
lose all the existing translations.
2022-04-12 14:23:14 +02:00
Javi Martín
600f5c35e9 Use file_validators instead of Papeclip validations
Since we're going to remove Paperclip and Active Storage doesn't provide
any validations, we have to either write our own validation rules or use
a different gem.

We're using the file_validators gem instead of the
`active_storage_validations` gem because the latter doesn't support
proc/lambda objects in size and content type definitions. We need to use
them because in our case these values depend on settings stored in the
database.
2022-02-23 18:21:38 +01:00
Javi Martín
9c4d406a77 Unify the logic to show the "not allowed" message
We were using the same logic six times regarding when we should show a
"participation not allowed" message. Since we're going to change the
current behavior, we're unifying the logic in one place so the changes
will be easier.
2022-02-23 16:43:37 +01:00
Javi Martín
168575d606 Remove "not allowed" when supporting comments
Hovering over the votes showed a "participation not allowed" message
which was annoying when scrolling with the browser or simply moving the
mouse around the page. Furthermore, it hid the information about the
number of votes, links to show/collapse replies, ...

We're planning to change the behavior of all the "participation not
allowed" messages in order to show them on click instead of showing them
on hover (just like it's done on touchscreens). In the case of comments,
supports, however, there's very limited space in the part showing the
number of supports for comments, so adding this message without breaking
the layout is challenging.

So, for now, we're simply redirecting unauthenticated users to the login
page. If find an easy way to implement a better user interface in the
future to display the "participation not allowed" message, we might
change this behaviour.
2022-02-21 18:48:09 +01:00
Javi Martín
413a77bd98 Add votable name to agree/disagree links aria-label 2022-02-21 18:47:37 +01:00
Javi Martín
4fd99e2d30 Add proposal name to vote links aria-label
This way blind screen reader users will know which proposal they're
supporting. In a list of proposals, context might not be clear when a
link saying "Support" or "Support this proposal" is announced, but a
link saying "Support Create a monthly transport ticket" is less
ambiguous.

Just like we did with investments in commit de436e33a, we're keeping the
title attribute because when visiting a proposal page, the connection
between the "Support" link and the proposal is not as clear as it is in
the proposals index page, so it might not be clear what you're
supporting.
2022-02-21 18:47:37 +01:00
Javi Martín
0bacd5baf3 Remove unused legislation proposals index action
The `legislation_proposals#index` action was never used because it used
the same URL as `legislation_processes#proposals`.

In commit 702bfec24 we removed the view, but we forgot to remove the
controller action, the route, and some partials which were rendered from
the index view.
2022-02-21 18:47:13 +01:00
Javi Martín
c45a0bd8ac Remove unused welcome#verification action
The route was deleted in commit 1cd47da9d and this feature was probably
only used in Madrid.
2021-12-20 14:42:53 +01:00
Javi Martín
baedac8839 Remove broken technical assistance text in footer
Originally there was a link pointing to the FAQ page but it was removed
in commit e14b7b67fb because by default the FAQ page in CONSUL only
contains a placeholder text.

We aren't sure where this link should point:

* FAQ page, only if the FAQ page is published
* Help page, only when the help feature is enabled
* CONSUL technical documentation page

So, for now, we're choosing the easiest solution which is removing the
text completely.
2021-12-13 13:30:24 +01:00
Javi Martín
708d49db86 Use a more precise required/optional fields legend
Usability tests showed some users were struggling when seeing the word
"Required" as a legend (it's actually styled as a title), since this
isn't a common pattern when filling in forms. They were expecting
something like "Fields with * are required", and so the "Required" text
alone made them feel the sentence wasn't complete.

We could also add an "*" to required fields in addition to the
"Required" text. In this case, however, some users wondered what the
asterisk was about: "It can't mean 'required' because they've already
said these fields are required".

We'll probably have to revisit required and optional fields again. For
now, we're just doing a small improvement.
2021-10-25 15:47:39 +02:00
Javi Martín
3347157b43 Remove placeholder in advanced search
When users see a label saying "With the text" and an input field, they
don't usually need a placeholder saying "Write the text". On the
contrary, this text adds noise and is hard to read due to the low
contrast between the color of the placeholder and the color of the
field, making the text an unnecessary distraction.
2021-09-11 17:28:38 +02:00
Javi Martín
9f1f912d84 Remove official level filter from advanced search
User testing has shown this filter isn't really useful and sometimes
makes users wonder what it's about. This is particularly true in CONSUL
installations which don't change the default values (most of them),
since users will see a filter with options like "Official position 1".
2021-09-11 17:28:38 +02:00
Javi Martín
9c8ee576a2 Merge pull request #4538 from andyjdavis/notificationTranslation
replace the word message with notification on proposal notification s…
2021-08-17 14:04:47 +02:00
Machine Learning
4d27bbebad Add experimental machine learning 2021-08-16 16:31:04 +02:00
Javi Martín
71f1f9a365 Fix typo in Spanish translation for "yes" 2021-07-26 14:11:13 +02:00
decabeza
909fd00714 Update styles and layout for new debates form 2021-07-13 15:27:14 +02:00
decabeza
823cc37ce8 Update styles and layout for new budget investment form 2021-07-09 14:25:24 +02:00
Javi Martín
1a477eb511 Remove unneeded optgroup in locale switcher
The `<optgroup>` doesn't make much sense if all options are inside one
group. And the information provided was redundant: when using a select
field having "Language" as a label, it's obvious that the options are
the available languages.

Now that, since now the `<select>` field is smaller, we need to add an
extra padding so the icon doesn't overlap the text.
2021-07-05 22:27:39 +02:00
Javi Martín
614e6da92b Use a submit button in budget executions filters
As mentioned in commit 5214d89c8, there are several issues with
submitting a form when a `<select>` tag changes. In particular, keyboard
users might accidentally fire the event while browsing the options, and
screen reader users will find a form with no obvious way to submit it.

In this case, there's an extra problem: in commit be8a0dbe8 we added a
second `<select>` field to this form, which also submitted on change.
Sometimes users changed one of the values and wanted to change the other
value as well before submitting the form. However, it wasn't possible,
because we would submit it before they had a chance to change the second
value.

So now we don't submit the form on change and add a submit button. This
is similar to what we do in the "Advanced filters" we use in several
places.
2021-06-30 14:14:43 +02:00
Javi Martín
d672a4294a Remove unused internationalization key
It looks like it isn't used since we replaced the order selector with
order links in debates a few years ago, in commit 7eda0b288.
2021-06-28 00:15:08 +02:00
Javi Martín
14d8bef0d8 Use order links in print proposals management
A `<select>` tag here might make more sense than in other similar places
since there are 5 options to choose among, and using links might take
too much screen space.

However, as mentioned in the previous commits, `<select>` tags which
automatically submit a form have many accessibility and usability
issues.

An alternative would be to create a dropdown menu with a button and a
list of links (similar to what Foundation does). I'm keeping the links
for simplicity and because the interface looks a bit more consistent
with the rest of the sections. Before these changes, we had a heading,
then a `<select>` field to choose the filter, and then a button to print
the page. We never use a similar interface, and some people might think
the "Print" button is related to the same form as the `<select>` field.

Now that we don't use the `order_selector` partial anywhere anymore, we
can remove it.
2021-06-28 00:15:08 +02:00
Javi Martín
5214d89c88 Use order links to sort comments and topics
We use order links in many places in the web. However, in the comments
section and the list of community topics, we were displaying a
`<select>` element, and changing the location when users select an
option.

This has several disadvantages.

First, and most important, it's terrible for keyboard users. `<select>`
fields allow using the arrow keys to navigate through their options, and
typing a letter will select the first option starting with that letter.
This will trigger the "change" event and so users will navigate through
a new page while they were probably just checking the available options
[1]. For these reasons, WCAG Success Criterion 3.2.2 [2] states:

> Changing the setting of any user interface component does not
> automatically cause a change of context unless the user has been
> advised of the behavior before using the component.

Second, the form didn't have a submit button. This might confuse screen
reader users, who might not know how that form is supposed to be
submitted.

Finally, dropdowns have usability issues of their own [3], particularly
on mobile phones [4]

The easiest solution is to use the same links we generally use to allow
users select an order, so using them here we make the user experience
more consistent. They offer one disadvantage, though; on small screens
and certain languages, these links might take too much space and not
look that great. This issue affects pretty much every place where we use
order or filter links, so we might revisit it in the future.

Note we're moving the links to order comments after the form to add a
new comment. In my opinion, having an element such as a form to add a
new comment between the element to select the desired order of the
comments and the comments themselves is a bit confusing.

[1] https://webaim.org/techniques/forms/controls#javascript
[2] https://www.w3.org/WAI/WCAG21/Understanding/on-input.html
[3] https://www.youtube.com/watch?v=CUkMCQR4TpY
[4] https://www.lukew.com/ff/entry.asp?1950
2021-06-28 00:08:18 +02:00
taitus
ee66c4182a Return error when the related content already exists
It looks like this bug was introduced in commit 7ca55c4. Before that
commit, a message saying "You added a new related content" was shown,
but (as expected) the related content wasn't added twice.

We now check this case and add a slightly clearer message.
2021-06-25 17:15:34 +02:00
Javi Martín
42c9645fb7 Improve label in dashboard actions link form
We were using a placeholder to indicate content which should be part of
a label.

It might be better to actually use "Link address" as a label instead of
"URL". I'm using "URL" because it's used in other places in the admin
section.
2021-06-23 19:52:50 +02: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
Andrew Davis
8991bb0302 replace the word message with notification on proposal notification screens 2021-06-04 20:05:57 +08:00
Melvin Lammerts
c34aa54122 Remove skip map checkbox 2021-06-03 11:13:52 +02:00
Julian Herrero
0698c0ff4f Allow users to delete their own comments 2021-04-13 20:04:04 +02:00
Javi Martín
e266e0e0e2 Simplify code to display text of new notifications
We couldn't do this refactoring earlier because we weren't using the
unread notifications count. This was fixed in the previous commit.
2021-02-18 14:45:48 +01:00
Javi Martín
0d8119a1e3 Use social-share-button whatsapp icon
We were using a custom icon because in the past social-share-button
didn't have support for whatsapp. But now that it does, we can remove
our custom icon.

Note we're using the `_app` suffix because that's the name of the icon
meant for mobile devices.
2021-02-08 16:31:26 +01:00
Javi Martín
ad56b01a9a Extract component to render "see more" link 2021-02-02 22:22:37 +01:00
Javi Martín
3ec628a63b Add SDG target filter to advanced search 2021-01-26 19:30:58 +01:00
Javi Martín
75fc4315ba Add goal filter to advanced search 2021-01-10 15:54:23 +01:00