Commit Graph

19 Commits

Author SHA1 Message Date
Javi Martín
b7e9d1118e Add ARIA labels to moderation checkboxes
This way it'll be easier for people using screen readers to know which
element the checkbox is related to.

Note that we're using the `aria-label` attribute because it makes
testing with Capybara easier than using the `aria-labelledby` attribute.
The only exception are the comments, since comments don't have a title
and there isn't a proper label for them. In this case, we're using the
title of the associated commentable as the label; we might change it in
the future since there might be many comments for the same commentable.
2024-11-08 15:03:55 +01:00
Javi Martín
ce1ee861f1 Simplify "check all/none" buttons layout
The float property was removed in commit b71c61e40, but then it was
added again in commit 4a6313fed.

It might have been necessary to do so back then because we had a
`select` field instead of the links to set the order, but now, instead
of making them float on the left and then make the next element clear
the floats, we can do nothing and obtain the same results.
2024-06-06 16:28:19 +02:00
Javi Martín
3753c42ab2 Open moderation links in the same window
Note that, unlike what we did in the admin section we're opening links
to budget investments on the same tab. There are two reasons for it; the
first one is that, in this case, there are no filters in the moderation
section that are lost after editing an investment, and the second one is
that, in this context, administrators usually don't go to the investment
in order to edit it, so they can just check something and use the
browser's back button to go back.
2023-10-24 16:31:39 +02:00
Javi Martín
d2f38fd276 Reduce duplication in moderation sections
We had five almost-identical views. Now we've removed most of the
duplication, although the tables are still similar. We might refactor
them in the future.
2021-06-28 00:15:08 +02:00
Javi Martín
5db6edfbd2 Simplify internationalization key in moderation
In keys like `hide_debates`, the suffix part is redundant when that key
is part of an absoulte key starting with `moderation.debates`.

This change will make it easier to remove duplication in moderation
views.
2021-06-28 00:15:08 +02:00
Javi Martín
7bf4e4d611 Sanitize descriptions in the views
Sanitizing descriptions before saving a record has a few drawbacks:

1. It makes the application rely on data being safe in the database. If
somehow dangerous data enters the database, the application will be
vulnerable to XSS attacks
2. It makes the code complicated
3. It isn't backwards compatible; if we decide to disallow a certain
HTML tag in the future, we'd need to sanitize existing data.

On the other hand, sanitizing the data in the view means we don't need
to triple-check dangerous HTML has already been stripped when we see the
method `auto_link_already_sanitized_html`, since now every time we use
it we sanitize the text in the same line we call this method.

We could also sanitize the data twice, both when saving to the database
and when displaying values in the view. However, doing so wouldn't make
the application safer, since we sanitize text introduced through
textarea fields but we don't sanitize text introduced through input
fields.

Finally, we could also overwrite the `description` method so it
sanitizes the text. But we're already introducing Globalize which
overwrites that method, and overwriting it again is a bit too confusing
in my humble opinion. It can also lead to hard-to-debug behaviour.
2019-10-21 21:32:02 +02:00
Julian Herrero
129a258f19 Use double quotes in app/views/moderation 2019-03-19 12:16:50 +01:00
Angel Perez
4a6313fed7 Add missing thead & tbody tags on moderation index views 2018-07-03 09:22:42 -04:00
Angel Perez
452d7dd252 Fix page entries information and filter positioning 2018-07-03 09:22:42 -04:00
Alberto Garcia Cabeza
b71c61e405 Improves styles for moderation section 2016-06-01 17:30:01 +02: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
Alberto Garcia Cabeza
058d6f6ffc Fixes moderation tables 2015-09-24 12:55:39 +02:00
Alberto Garcia Cabeza
7dfdce8c07 Improves styles for admin buttons and selects 2015-09-24 12:40:16 +02:00
kikito
3b405f3e29 changes css style name to avoid conflicts 2015-09-22 14:23:11 +02:00
kikito
1d5904d478 displays the complete text of the proposal in the moderation interface 2015-09-21 12:47:13 +02:00
Alberto Garcia Cabeza
98ae8c8014 Fixes proposal moderation 2015-09-15 14:19:56 +02:00
kikito
9d253b0477 Implements Proposals moderation controller 2015-09-13 22:08:30 +02:00
kikito
df7fde472b Adds missing view: moderation/proposals/hide.js 2015-09-13 22:07:44 +02:00