Commit Graph

46 Commits

Author SHA1 Message Date
Javi Martín
b4b33926cf Fix HTML closing tags
In some places, we accidentally opened the same tag twice instead of
closing it, while in some other places we closed a tag without opening
it in the first place.

We've detected these issues thanks to the HTML Beautifier gem, which
we're about to start using for indentation purposes.
2025-03-07 16:02:07 +01:00
Sebastia
d76f95459e Merge pull request #5369 from consuldemocracy/refactor_comments_specs
Make comments specs faster
2024-03-25 15:04:04 +01:00
Javi Martín
b9e137619a Simplify the way we provide the title in most cases
This is consistent with the way we're providing the main class.

Note we're still setting the title using a block in more complex cases.
2024-03-23 00:35:47 +01:00
taitus
260196ca54 Use comments component for legislation annotations and questions 2024-03-22 08:56:13 +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
taitus
d96a91710f Fix broken h3 tag
Since we're now allowing <h2> and <h3> tags in the description, we
remove the broken <h3> tag from quiz-question class. Since its content
is also in the <title> element, and in order to be consistent with other
show actions in the public area, we change this tag to <h1>.

We add <h2> tag in the "Share" heading and we replace the broken <h4>
tag above adding new styles.
2023-02-22 19:19:27 +01:00
decabeza
800027728a Add description to legislation questions 2023-02-22 00:52:51 +01:00
taitus
9f90125fa7 Add attribute anchor to link
Anchor needs to be added to the link to redirect directly to the comments section.
2022-08-19 15:40:51 +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
taitus
0ca17c6fae Unify comment icon on legislation questions
Remove unnecessary span class "debate-comments".

We take advantage of this commit to also unify the format of the date
that appears next to the comments with the rest of the application. The
format that we removed is being used on the same page in the
"Participation phases" tab (I guess that was the reason for putting it
the same) but I think it makes more sense to use the date format that is
used in this kind section in the rest of the application.
2022-08-19 14:25:34 +02:00
Javi Martín
9154614577 Always show not allowed message in legislation debates
This message is only shown in the `show` action, so it's shown at most
once in the whole page, so it doesn't take up too much space and it
isn't as overwhelming as if we were showing it on the index page, once
per debate.

We're only showing it when there are closed options, though, since
there's already a message to sign in to comment when the question
accepts open answers.
2022-02-21 18:48:09 +01:00
decabeza
bcfb9b7a18 Use complete keys on legislation translations 2020-08-07 10:29:39 +02:00
Javi Martín
573f861ad1 Don't use comment_flags to cache comments
Flagging a comment automatically updates the comment, so the cache
expires anyway, making the `comment_flags` variable redundant.
2020-05-11 16:09:23 +02:00
Javi Martín
fa070f326e Remove unnecessary content_tag calls
We're usually using HTML tags in views instead.
2020-04-27 19:26:37 +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
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
911fe4e481 Simplify calls to render partial
We're also adding a bit of consistency, since most of our calls to
partial rendering omit the `partial` and `locals` keys.
2019-09-04 15:00:36 +02:00
Javi Martín
3e4e65ead7 Use double quotes inside ERB
We were using single quotes inside ERB code when that code was inside
HTML double quotes.
2019-03-25 14:58:54 +01:00
Julian Herrero
2b83be1c7c Use double quotes in app/views/legislation 2019-03-19 12:16:50 +01:00
decabeza
0bf31bde6c Updates all active to is-active classes 2018-06-06 12:02:13 +02:00
decabeza
827e4702a9 removes duplicated social share partial on legislation views 2017-08-16 13:40:46 +02:00
Bertocq
6c386ffd95 Make comments count display optional using a variable on comments comment_tree partial 2017-06-26 19:23:49 +02:00
Bertocq
523988a291 Replace old open_phase? method for new phase/publication open? on Legislative Process 2017-06-13 22:04:36 +02:00
Amaia Castro
3ab6adbb1b Refactor share buttons partial to use gem helper 2017-03-25 13:54:33 +01:00
Amaia Castro
d656de680d Social share buttons for annotation 2017-02-09 15:32:42 +01:00
Amaia Castro
53e9837db3 Change texts for legislation questions comments 2017-01-17 15:42:42 +01:00
Martín González
eadf933c22 Change debate questions class to avoid colliding with other CSS 2017-01-13 16:42:59 +01:00
Martín González
5a5fed975a Push changes 2017-01-13 16:19:57 +01:00
Martín González
1cf074a297 Fix identation and markup issue on the legislation question page 2017-01-13 15:41:23 +01:00
Martín González
a0011b7c5c More css fixes 2017-01-12 11:55:12 +01:00
Amaia Castro
f974883556 Refactor legislation comments partials 2017-01-11 16:27:22 +01:00
Fernando Blat
8682e426ac Show warning if phase is not open 2017-01-05 13:08:06 +01:00
Fernando Blat
de13574617 Show link to the first question 2017-01-05 12:31:20 +01:00
Fernando Blat
ba0089ac44 Truncate social networks text 2017-01-05 11:05:45 +01:00
Amaia Castro
f505d6fec7 Check if debate phase is open to create answers 2016-12-28 22:02:08 +01:00
Amaia Castro
646ec67595 ‘Participation not allowed’ hover for legislation questions 2016-12-28 17:37:17 +01:00
Amaia Castro
2693393eb0 Answer question through ajax 2016-12-28 16:21:58 +01:00
Amaia Castro
a6ceab6d73 Answer legislation questions 2016-12-27 19:49:03 +01:00
Amaia Castro
55eb03531c Comments in legislation question page 2016-12-23 09:35:02 +01:00
Amaia Castro
f68b6a2f32 Question title for page and share links 2016-12-22 17:27:59 +01:00
Amaia Castro
368430d914 Legislation Question page 2016-12-22 16:00:28 +01:00
Amaia Castro
36399277ec Legislation Process page 2016-12-22 11:23:49 +01:00