Commit Graph

10 Commits

Author SHA1 Message Date
Javi Martín
c8d8fae98d Move related list partial to a component
This way the code is easier to follow; the code checking whether the
list has contents is in the partial rendering the list.

We also remove some duplication setting up related content in the
controllers.

For some reason, we have to manually ignore i18n keys which were
automatically ignored when the code was in the view.
2021-08-16 16:30:13 +02:00
Javi Martín
089fe3cd1f Put button to add content next to its related form
This way the relationship between the two elements is more obvious. And
since now the button and the form are siblings, it's easier to find one
based on the other using CSS or JavaScript.
2021-06-23 23:06:18 +02:00
Javi Martín
767b65e7d6 Remove unused related content button ID attribute 2021-06-22 22:33:02 +02:00
Javi Martín
ea2a613359 Render related content form just to signed in users
It doesn't make much sense to render a hidden form to users who will not
be able to use it.
2021-06-22 22:33:02 +02:00
Javi Martín
8a697216d1 Fix invalid HTML in related content button
A button cannot be inside an anchor tag, and it might confuse some
browsers or screen readers.

We're also making it clear in the tests that the intention is to use a
button there by using `click_button` instead of `click_on` since the
latter also clicks on links.
2021-06-22 22:32:08 +02:00
Julian Herrero
f6489bc604 Use double quotes in app/views 2019-03-19 12:33:07 +01:00
decabeza
44b34eb2ac shows add related content link if user is logged 2017-12-19 18:51:46 +01:00
María Checa
067945518e Added check for related_contents 2017-12-15 17:22:27 +01:00
María Checa
586b1ae201 Added related content form 2017-12-14 14:50:47 +01:00
María Checa
4f442792cc Added working related contents list
Also separated related contents into partials.
2017-12-13 13:32:00 +01:00