Change surveys public page and use TOS#1410
Conversation
770aad2 to
1ef26f8
Compare
Codecov Report
@@ Coverage Diff @@
## feature/surveys #1410 +/- ##
===================================================
- Coverage 94.86% 67.8% -27.06%
===================================================
Files 444 62 -382
Lines 7554 966 -6588
===================================================
- Hits 7166 655 -6511
+ Misses 388 311 -77
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## feature/surveys #1410 +/- ##
===================================================
+ Coverage 94.89% 94.89% +<.01%
===================================================
Files 445 445
Lines 7593 7599 +6
===================================================
+ Hits 7205 7211 +6
Misses 388 388 |
|
Careful with the margins and paddings, especially on the bottom part (the disclaimer) |
|
@josepjaume Yeah! I'll fix it but we have the same problem in decidim-hospitalet :( |
3a57a3b to
14e5bb2
Compare
14e5bb2 to
7a9a741
Compare
|
@beagleknight, thanks for your PR! By analyzing the history of the files in this pull request, we identified @mrcasals and @oriolgual to be potential reviewers. |
| end | ||
|
|
||
| def body_not_blank | ||
| errors.add("body", :blank) if body.all?(&:blank?) |
There was a problem hiding this comment.
mmm no. Since body is an array it prevents submitting this [""].
There was a problem hiding this comment.
Maybe I'm missing something, why is body an array? What I meant is that if any element of the array is blank we should fail.
There was a problem hiding this comment.
The body is an array because the user can choose multiple answers like: ["Answer A", "Answer B"]. I'm using the same field to store single answer questions as well so if the user doesn't fill in the answer it sends [""] to the server.
| title: Answer the survey | ||
| are_you_sure: This action cannot be undone and you will not be able to edit | ||
| your answers. Are you sure? | ||
| authorize_toc: Authorize toc |
| # locale - the ID of the locale to check | ||
| def have_i18n_content(field, locale: I18n.locale) | ||
| have_content(stripped(translated(field, locale: locale))) | ||
| # upcase - a boolean to indicate wether the string must be checked upcased or not. |
| <div class="callout success"> | ||
| <h5><%= t('.survey_answered.title') %></h5> | ||
| <p><%= t('.survey_answered.body') %></p> | ||
| <% else %> |
There was a problem hiding this comment.
I hate these unless ... else ..., I feels it's hard to grasp the logic. Can you switch the order of the blocks?
if survey.published?
<the part below>
else
<the part above
You can do this in another PR

🎩 What? Why?
I used survey's TOS and fix a few issues of the public survey form. I also changed some styles.
📌 Related Issues
📋 Subtasks
📷 Screenshots (optional)
👻 GIF