Commit Graph

23 Commits

Author SHA1 Message Date
Javi Martín
c3e0a6b089 Remove duplication rendering comments
We were using the same code 5 times, with the only slight variation
being the extra heading in the debates section.
2021-06-27 23:22:00 +02:00
Javi Martín
ae41becd3a Use CSS to hide reply forms
We were using inline styles and passing local variables around, while
the rule we were following is very simple: it's only hidden if it's a
form to reply to a comment.
2020-05-12 23:57:57 +02:00
Javi Martín
4627372a62 Use a <ul> tag for a list of comments
We were using a <ul> tag for a single comment, where the first element
of the list was the comment itself and the second element was the list
of replies.

IMHO it makes more sense to have a list of all comments, where every
element is a comment and inside it there's a list of replies.

We're also rendering the list even if it has no children so it's easier
to add comments through JavaScript. Then we use the :empty CSS selector
to hide the list if it's empty. However, since ERB adds whitespace if we
structure our code the usual way and current browsers don't recognize
elements with whitespace as empty, we have to use the `tag` helper so no
whitespace is added.
2020-05-12 23:57:16 +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
f5d8badeb6 Extract partial to show "login to comment" message 2019-10-05 14:07:24 +02:00
Javi Martín
ae64458fce Use the same I18n key for "login to comment" text
We were using several different keys, all of them having the same
translations.
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
Julian Herrero
b78ff808c1 Use double quotes in app/views/debates 2019-03-19 12:16:50 +01:00
Alberto Garcia Cabeza
76a3c61020 improves html structure for comments on debates and proposals 2016-12-19 13:43:09 +01:00
Alberto Garcia Cabeza
3752f3a53b Adds foundation 6 🎉 2016-02-26 19:33:33 +01:00
kikito
60b3c65b05 Refactor comment tree calculation using a PORO 2015-10-30 17:00:32 +01:00
kikito
bfd89ed15a Adds current order to the comments cache in proposals and debates 2015-10-29 17:36:50 +01:00
kikito
e4bfc72649 Refactors design of comments order selector into a partial with i18n 2015-10-28 15:48:48 +01:00
Alberto Garcia Cabeza
82eb0bd902 Adds comments filter for debates and proposals 2015-10-28 13:28:37 +01:00
Sergio Arbeo
12ec1fe6f6 Update comments count when commenting on a debate or proposal 2015-10-27 01:02:39 +01:00
Juanjo Bazán
30bf5023b3 adds cache to debates/_comments partial
cache does not invalidate on updates of debate other than comments_count
2015-09-09 15:00:18 +02:00
rgarcia
13cf1d9449 removes all comments cache 2015-09-07 10:55:23 +02:00
Juanjo Bazán
ca8c445404 removes close button from alert for no-logged user 2015-09-06 20:40:11 +02:00
Álvaro Durán Tovar
92ae988251 adds close button to alert boxes, also adds
data-alert attribute to enable javascript
on them
2015-09-06 19:54:12 +02:00
Juanjo Bazán
31b00c32f4 removes unneeded to_a 2015-09-06 12:25:47 +02:00
Juanjo Bazán
60089b8986 uses author info in comment/debate cache
author is already preloaded and we avoid expensive touching methods
2015-09-06 12:13:39 +02:00
rgarcia
5200d76be6 caches comments 2015-09-05 22:02:51 +02:00