Commit Graph

89 Commits

Author SHA1 Message Date
decabeza
0896701b57 Remove unused document section on polls
This section is not used because it's only possible to add documents to the poll's answers not to the poll itself.
2020-06-18 09:30:25 +02:00
Javi Martín
af7c37634d Remove poll votation types
Unfortunately this feature wasn't properly reviewed and tested, and it
had many bugs, some of them critical and hard to fix, like validations
being skipped in concurrent requests.

So we're removing it before releasing version 1.1. We might add it back
in the future if we manage to solve the critical issues.

This commit reverts commit 836f9ba7.
2019-10-30 18:48:55 +01:00
Javi Martín
7bf4e4d611 Sanitize descriptions in the views
Sanitizing descriptions before saving a record has a few drawbacks:

1. It makes the application rely on data being safe in the database. If
somehow dangerous data enters the database, the application will be
vulnerable to XSS attacks
2. It makes the code complicated
3. It isn't backwards compatible; if we decide to disallow a certain
HTML tag in the future, we'd need to sanitize existing data.

On the other hand, sanitizing the data in the view means we don't need
to triple-check dangerous HTML has already been stripped when we see the
method `auto_link_already_sanitized_html`, since now every time we use
it we sanitize the text in the same line we call this method.

We could also sanitize the data twice, both when saving to the database
and when displaying values in the view. However, doing so wouldn't make
the application safer, since we sanitize text introduced through
textarea fields but we don't sanitize text introduced through input
fields.

Finally, we could also overwrite the `description` method so it
sanitizes the text. But we're already introducing Globalize which
overwrites that method, and overwriting it again is a bit too confusing
in my humble opinion. It can also lead to hard-to-debug behaviour.
2019-10-21 21:32:02 +02:00
Javi Martín
2aabf79fb4 Rename methods to add auto links to HTML
The name `safe_html_with_links` was confusing and could make you think
it takes care of making the HTML safe. So I've renamed it in a way that
makes it a bit more intuitive that it expects its input to be already
sanitized.

I've changed `text_with_links` as well so now the two method names
complement each other.
2019-10-08 18:46:20 +02:00
lalo
c6e4b2480f Add public changes to create and vote Poll:Questions with votation type 2019-06-12 19:44:14 +02:00
decabeza
585f9ea5ab Remove token on views temporally 2019-05-29 15:49:28 +02:00
decabeza
607b2362a3 adds missing id 2019-05-21 13:26:44 +02:00
decabeza
467d05ab98 Replace poll summary to title on social meta tags 2019-04-24 14:03:39 +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
f6489bc604 Use double quotes in app/views 2019-03-19 12:33:07 +01:00
decabeza
1116340f99 Removes participate in other polls button 2018-07-13 18:27:32 +02:00
decabeza
abf0fe992e Removes tablist and tab roles 2018-07-04 17:14:24 +02:00
decabeza
6a812659c3 Adds missing tablist and tab roles 2018-06-06 12:01:17 +02:00
María Checa
84f67db26d Added restrictions to access Poll results and stats 2017-10-23 14:17:25 +02:00
decabeza
96f588566a changes id name to specs 2017-10-22 01:06:03 +02:00
decabeza
a0eb6e56a1 fixes styles for polls tabs, uses underscore for ids 2017-10-19 12:23:57 +02:00
María Checa
70a35fbe58 Poll views improvements
Reorganized poll `#show`,  `#stats` and `#results` views. Gave stats section its own route.
2017-10-18 18:35:53 +02:00
iagirre
81b1fb1a72 Fixed some conflicts automatically merged that didn't realised before they were there 2017-10-18 10:27:41 +02:00
iagirre
f7bb3ec8b7 Merge remote-tracking branch 'consul/master' into iagirre-poll-stats 2017-10-18 09:48:02 +02:00
iagirre
0f73b787b2 Fixed views and Poll::Stats model to pass the specs 2017-10-17 16:07:44 +02:00
iagirre
6a292daf42 Partial to render the polls stats and model methods to get the information from DB 2017-10-17 15:04:29 +02:00
BertoCQ
db7c80ef13 Merge pull request #2021 from consul/fixed-already-voted-message
Fixed already voted message in poll show
2017-10-17 14:42:46 +02:00
María Checa
58f57bc15b Added poll method voted_in_web? 2017-10-17 13:16:46 +02:00
BertoCQ
a476019c49 Merge pull request #2020 from consul/poll-videos
Poll answer videos
2017-10-16 20:03:34 +02:00
iagirre
78cc09cc5a Controllers and models to see the polls stats. Routes related also added. 2017-10-16 17:25:04 +02:00
iagirre
2c6c320fa1 When answer 2 more info expand is clicked, it expands on top of the first one, not below. Same if the expand is clicked for the first answer 2017-10-13 14:38:30 +02:00
decabeza
3a20a6bc2a adds margin to read more answer description link 2017-10-11 20:16:38 +02:00
Bertocq
34c278db74 Small fixes for Poll Question Answer ordering 2017-10-11 12:05:20 +02:00
rgarcia
faa2f31b3a Adds comment's tab 2017-10-10 12:06:41 +02:00
Raimond Garcia
2b588753ee Merge branch 'master' into mlucena-poll-comments 2017-10-09 17:59:12 +02:00
María Checa
3fc3f9e88e Fixed condition 2017-10-09 17:42:13 +02:00
María Checa
f23073bb28 Fixed already voted message in poll show 2017-10-09 13:12:44 +02:00
decabeza
ba9814cd85 shows videos on polls answers 2017-10-09 13:01:39 +02:00
María Checa
316ba37d91 Requested changes 2017-10-07 20:27:44 +02:00
María Checa
65f5c9efa9 Changed token message background color 2017-10-07 19:21:27 +02:00
María Checa
728edf64a5 Added "participate in other polls" link in poll show 2017-10-07 19:12:58 +02:00
María Checa
ca24be79e3 Moved token message below questions 2017-10-07 19:12:17 +02:00
Raimond Garcia
689b6ecb9d Merge pull request #2011 from consul/show-poll-answers-after-booth-vote
Show poll answers in poll show view after voting on a booth
2017-10-07 18:20:29 +02:00
María Checa
8b2f6d454c Show poll answers in poll show view after voting on a booth
If the user votes in a booth, it can see the poll and answers but can't see what he/she voted and the answers are inactive (no link, inactive ui style).
2017-10-07 17:33:27 +02:00
decabeza
7cfd47ad87 removes duplicated content on polls show 2017-10-07 17:11:40 +02:00
rgarcia
a08d5bdba9 fixes conflict in merge 2017-10-07 17:00:26 +02:00
Raimond Garcia
2e4ce39722 Merge pull request #1994 from consul/feature/1985#voting_token
Voter Answer unique Token
2017-10-07 16:54:01 +02:00
decabeza
12427e1ce5 adds styles to document link on polls show 2017-10-07 14:46:55 +02:00
decabeza
316b6720cb fixes polls show indentation and adds missing <% end %> 2017-10-07 14:31:04 +02:00
Alberto García
ca724c7d25 Merge branch 'master' into polls-gallery-polish 2017-10-07 14:26:50 +02:00
decabeza
a5d3d5d239 adds links to read more and less for answer description 2017-10-07 11:53:34 +02:00
María Checa
e127b52225 Minor fixes 2017-10-07 11:37:33 +02:00
BertoCQ
6a0197a61b Merge branch 'master' into feature/1985#voting_token 2017-10-07 10:46:13 +02:00
decabeza
cd495c80fe changes border right to bottom when expand gallery 2017-10-07 02:08:01 +02:00
rgarcia
5f1485dbfa fixes specs 2017-10-06 22:49:53 +02:00