Commit Graph

37 Commits

Author SHA1 Message Date
Javi Martín
765ab758dc Extract component to render a poll in the poll index
This is consistent with the way we've got partials to render debates,
proposals and legislation processes on their index pages.

Note that, while adding the tests for the status icon, we're keeping one
system test because it also tests the process of voting. We're adding a
new, similar component test, where the voter is created in the database,
so all possible statuses are tested in the component.
2024-06-07 15:52:02 +02:00
decabeza
717845ff1a Change poll button if results or stats are enabled 2023-01-12 15:19:10 +01:00
Javi Martín
091abfc944 Use Active Storage to render attachments
This way we fix a bug we mentioned in commit 930bb753c which caused
links to documents to be broken when editing their title because the
title was used to generate the URL of the document.

Note we're still using Paperclip to render cached attachments because
this is the only case where we store files with just Paperclip and not
Active Storage.

With Active Storage, we render attachments just like any other resource,
using `polymorphic_path`. Paperclip included the `url` method in the
model; since the model doesn't have access to the request parameters
(like the host), this was inconvenient because it wasn't possible to
generate absolute URLs with Paperclip.

In order to simplify the code and make it similar to the way we used
Paperclip, we're adding a `variant` method accepting the name of a
variant and returning the variant.
2022-02-23 18:21:38 +01:00
decabeza
9709b267a2 Always show order poll questions by created at
PostgreSQL doesn't guarantee the order of the records, so we have to
specify it if we want the questions to be displayed in a consistent
order.
2021-10-18 13:31:34 +02:00
Javi Martín
19bab5a9dc Add related SDG and targets tags to polls 2021-01-31 13:33:27 +01:00
Javi Martín
0d3c4c8154 Simplify styling tags
This way we won't have to add the `inline-block` and `no-bullet` classes
to other elements and we can define the styles in one place.

Note we're using the `ul.tags` selector instead of just `.tags` to avoid
conflicts with a `div.tags` selector which is used to select tags in a
form. Renaming the selector to `.tag-list` would be better, but we
aren't doing so because it would break custom stylesheets using that
selector.

Also note we're keeping the %tags placeholder selector in `.tags`
selector in the participation.scss file. This is so styles are not
overwritten by selectors like `.debate-show ul li`, which has the same
specifity as `ul.tags li`.
2021-01-27 15:55:21 +01:00
Javi Martín
2d29243a9e Simplify code to link to a poll with one question 2019-05-22 11:49:35 +02:00
Javi Martín
5ca528d2ce Extract method to link to a poll 2019-05-21 17:30:46 +02:00
rgarcia
1af472b795 hotfix for polls without slugs 2019-05-16 23:40:50 +02:00
Bertocq
501fe9b682 Fix poll_path links to adding id param 2019-05-16 23:40:50 +02:00
María Checa
e3b16230e6 Added slug to polls for named urls 2019-05-16 23:40:50 +02:00
decabeza
bc1679550b Remove incoming polls filter 2019-02-08 14:28:19 +01:00
decabeza
bc5741fb16 Adds status icons on polls poll group 2018-08-23 18:46:14 +02:00
decabeza
725c282ba5 Adds unicode_normalize for alt and title on images 2018-04-27 18:24:17 +02:00
decabeza
0950a98ddd fixes css class name 2018-01-18 00:24:32 +01:00
decabeza
39def428b5 improves layout for items list with images 2017-12-06 21:00:34 +01:00
rgarcia
21c7ff15fe fixes routes for poll's results and stats 2017-10-23 21:39:59 +02:00
decabeza
da00ac947e replaces link on poll title if results or stats are enabled 2017-10-23 19:56:26 +02:00
decabeza
71d785ba78 improves polls index view on mobile version 2017-10-07 19:38:17 +02:00
María Checa
bdffab7d72 Fixed already-answered logic
Added condition to check if user is unverified to avoid showing the ui element that lets users know they already voted a poll.
2017-10-07 16:56:35 +02:00
decabeza
ad8f58993f checks already answered polls only for users logged 2017-10-05 17:48:52 +02:00
decabeza
5fdbc7b8a6 removes icons on polls index view 2017-10-05 16:29:57 +02:00
decabeza
e4205dc22a includes poll image on polls index 2017-10-04 11:40:20 +02:00
decabeza
ad08303dfd removes question link on polls index 2017-10-04 10:12:54 +02:00
decabeza
f497227e3f improves layout for polls index view 2017-10-02 12:24:31 +02:00
taitus
9b6b57a24c Remove all white spaces 2017-09-06 14:12:32 +02:00
decabeza
3bcfaeb61a replaces sr-only class to show-for-sr 2017-06-13 17:51:57 +02:00
Alberto Garcia Cabeza
bf3e301bb1 changes button text depending of poll status 2017-03-06 12:29:13 +01:00
Alberto Garcia Cabeza
086b4108e7 improves message of geozone info on poll index 2017-02-08 22:19:33 +01:00
Alberto Garcia Cabeza
26ac9f6759 makes buttons 100% width on mobile version 2017-02-06 12:04:50 +01:00
Alberto Garcia Cabeza
46d9961c36 adds icon if already answer poll 2017-02-03 17:43:44 +01:00
Alberto Garcia Cabeza
54472852ca changes link to poll on polls with one question 2017-02-03 14:26:56 +01:00
Alberto Garcia Cabeza
6728fe6751 adds icons of answerable on polls index 2017-02-03 14:23:26 +01:00
Alberto Garcia Cabeza
cef9bf600c shows question as title if poll has only one question 2017-02-03 12:34:34 +01:00
Alberto Garcia Cabeza
ce8cd79c87 adds message before geozone tags on poll index 2017-02-02 19:33:40 +01:00
Juanjo Bazán
ee3b725831 avoids loop to render 2017-02-01 17:37:16 +01:00
Alberto Garcia Cabeza
a490b88865 moves polls_group to partial 2017-02-01 17:31:04 +01:00