Commit Graph

21 Commits

Author SHA1 Message Date
Javi Martín
2db807baa7 Restrict access to the "new" direct message action
This way only verified users will be able to access this page, which
shows the username of the receiver of the direct message. With this,
it's no longer possible for unverified users to browse direct message
URLs in order to collect usernames from every user.
2023-12-01 13:02:33 +01:00
Javi Martín
629e208e9d Add and apply ArgumentAlignment rubocop rule
We're choosing the default `with_first_argument` style because it's the
one we use the most.
2023-08-18 14:56:16 +02:00
Javi Martín
928312e218 Use sanitize in translations with links
Sometimes we're interpolating a link inside a translation, and marking
the whole translations as HTML safe.

However, some translations added by admins to the database or through
crowdin are not entirely under our control.

Although AFAIK crowdin checks for potential cross-site scripting
attacks, it's a good practice to sanitize parts of a string potentially
out of our control before marking the string as HTML safe.
2019-10-08 18:46:21 +02:00
Javi Martín
2aabf79fb4 Rename methods to add auto links to HTML
The name `safe_html_with_links` was confusing and could make you think
it takes care of making the HTML safe. So I've renamed it in a way that
makes it a bit more intuitive that it expects its input to be already
sanitized.

I've changed `text_with_links` as well so now the two method names
complement each other.
2019-10-08 18:46:20 +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
3ea9f3cecf Simplify generating form fields with labels
Instead of generating the label and then a field without a label, we can
directly generate a field with a label.
2019-10-05 16:01:58 +02:00
Javi Martín
86a205c8fc Extract link to verify account to a mehtod
We were using the same text and the same route in many places.
2019-10-05 14:20:03 +02:00
Javi Martín
f8bd3d4f39 Extract links to signin and signup to methods 2019-10-05 14:07:24 +02:00
Javi Martín
2ccc283bb7 Use the same I18n key for "verify account" text
We were using several different keys, all of them having the same text.
2019-10-05 14:07:24 +02:00
Javi Martín
78c6f6f7e9 Use the same key for "signin" and "signup" texts
We were using the same texts in several places
2019-10-05 14:07:23 +02:00
Javi Martín
f9ed186909 Add rubocop spacing rules
We were following these rules in most places; we just didn't define them
anywhere.
2019-09-10 21:04:56 +02:00
Javi Martín
c62da726b8 Apply SpaceAroundErbTag ERB Lint rule 2019-09-10 20:02:15 +02:00
decabeza
98961748ad replaces more old back link partial to new back_link_to helper 2017-07-27 00:26:39 +02:00
decabeza
0b235d69d4 adds consistency for back links 2017-07-26 18:18:30 +02:00
Alberto Garcia Cabeza
e8312ff86a fixes text format on direct messages 2016-10-18 16:40:59 +02:00
rgarcia
91860cb409 validates that a user does not want to receive direct messages 2016-06-16 11:23:03 +02:00
rgarcia
00fc5b77e5 adds permissions in view for direct messages 2016-06-09 17:42:13 +02:00
Alberto Garcia Cabeza
900d997000 Adds message for unverified users 2016-06-09 17:15:11 +02:00
Alberto Garcia Cabeza
999f5bbde3 Improves styles for direct messages 2016-06-09 16:01:03 +02:00
Alberto Garcia Cabeza
ad856521fc Adds translations for direct messages 2016-06-09 16:00:13 +02:00
rgarcia
c3d06c8bd0 adds direct messages 2016-06-08 20:44:54 +02:00