Commit Graph

20 Commits

Author SHA1 Message Date
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
cac24b0159 Extract component to show moderation actions
Note that in proposal notifications we're writing the call to
render the component in the same line as the <div class="reply">
definition in order to be able to use the `:empty` selector when the
component renders nothing. No browser matches whitespace with the
`:empty` selector, so we can't add newline characters inside the tag. A
more elegant solution would be extracting the proposal notification
actions to a component and only rendering it if the moderation actions
component is rendered.
2021-12-30 15:50:03 +01:00
rhian-cs
b27a05cbfd Make confirmation alert message inform the triggering action 2021-12-22 12:32:45 +01:00
Javi Martín
b66859945e Remove _html suffix from already sanitized texts
Using the `_html` suffix automatically marks texts as HTML safe, so
doing so on sanitized texts is redundant.

Note flash texts are not sanitized the moment they are generated, but
are sanitized when displayed in the view.
2019-10-09 19:46:47 +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
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
Julian Herrero
7fe6285fe3 Use double quotes in app/views/proposals 2019-03-19 12:16:50 +01:00
decabeza
8900b1ffce Shows flag actions div only if user can hide 2018-07-04 17:14:29 +02:00
iagirre
88a8aaa083 Add hide button in the user interface
The little menu with the hide notification link and block user link
has been added to each proposal notification.

JS for adding the fade efect has also been added.
2018-07-02 18:19:08 +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
taitus
5fe894aa6b New proposal method to get users_to_notify. 2017-07-07 13:38:52 +02:00
taitus
b29bf62f56 Send proposals notifications to followers. 2017-07-07 13:37:55 +02:00
Alberto Garcia Cabeza
419ced5a18 Adds text to form new 2016-06-15 21:14:56 +02:00
Alberto Garcia Cabeza
e87fda2c8d Adds comments anchor on form link 2016-06-15 17:03:33 +02:00
Alberto Garcia Cabeza
14f17983f4 Improves styles for about receivers message 2016-06-06 17:30:31 +02:00
rgarcia
a2c9756c18 displays message about receivers 2016-06-06 16:50:00 +02:00
Alberto Garcia Cabeza
0ef316de91 Improves styles for proposal notifications 2016-06-02 13:36:41 +02:00
rgarcia
f5375e813d stores a proposal notification 2016-06-01 17:23:56 +02:00