From d62c0d5d0531f148eaac81f5ff4cea5bde4be211 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Fri, 6 Oct 2017 11:41:31 -0400 Subject: [PATCH 1/5] Remove Poll::Question title length limit As requested by #1997 --- app/views/admin/poll/questions/_form.html.erb | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/app/views/admin/poll/questions/_form.html.erb b/app/views/admin/poll/questions/_form.html.erb index d197112f5..17ebde59d 100644 --- a/app/views/admin/poll/questions/_form.html.erb +++ b/app/views/admin/poll/questions/_form.html.erb @@ -12,13 +12,19 @@ label: t("admin.questions.new.poll_label") %> - <%= f.text_field :title, maxlength: Poll::Question.title_max_length %> + <%= f.text_field :title %>
<%= f.label :video_url, t("proposals.form.proposal_video_url") %> -

<%= t("proposals.form.proposal_video_url_note") %>

- <%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"), label: false, - aria: {describedby: "video-url-help-text"} %> + +

+ <%= t("proposals.form.proposal_video_url_note") %> +

+ + <%= f.text_field :video_url, + placeholder: t("proposals.form.proposal_video_url"), + label: false, + aria: {describedby: "video-url-help-text"} %>
From 7fad60484220bb0e5a1796821a7bade726b81540 Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Fri, 6 Oct 2017 13:09:33 -0400 Subject: [PATCH 2/5] Avoid show div into markup for answers' information If an answer does not contain any description or images associated, the "poll-more-info-answers" div won't be shown in the markup Change requested by #1998 --- app/views/polls/show.html.erb | 38 +++++++++++++++++------------------ 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 1eb128333..e3405c0a8 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -66,29 +66,29 @@
-
-
+ <% @poll.questions.map(&:question_answers).flatten.each do |answer| %> + <% if answer.description.present? || answer.images.any? %> +
+
- <% @poll.questions.map(&:question_answers).flatten.each do |answer| %> -
+
- <% if answer.description.present? %> -

<%= answer.title %>

- <% end %> + <% if answer.description.present? %> +

<%= answer.title %>

- <% if answer.images.any? %> - <%= render "gallery", answer: answer %> - <% end %> +
+ <%= safe_html_with_links simple_format(answer.description) %> +
+ <% end %> - <% if answer.description.present? %> -
- <%= safe_html_with_links simple_format(answer.description) %> -
- <% end %> + <% if answer.images.any? %> + <%= render "gallery", answer: answer %> + <% end %> +
- <% end %> -
-
+
+ <% end %> + <% end %>
From a1907c6f50052f758e0c9c175cd7ebe8ca44c36d Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Fri, 6 Oct 2017 14:40:54 -0400 Subject: [PATCH 3/5] Show answer's associated documents on polls As requested by #2003 --- app/views/polls/show.html.erb | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index e3405c0a8..8347455ae 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -67,7 +67,7 @@ <% @poll.questions.map(&:question_answers).flatten.each do |answer| %> - <% if answer.description.present? || answer.images.any? %> + <% if answer.description.present? || answer.images.any? || answer.documents.present? %>
@@ -86,7 +86,18 @@ <%= render "gallery", answer: answer %> <% end %> + <% if answer.documents.present? %> + <% answer.documents.each do |document| %> + + <%= link_to document.title, + document.attachment.url, + target: "_blank", + rel: "nofollow" %> + + <% end %> + <% end %>
+
<% end %> From 8b8e8aff8fa636748128e4a3ab377fb19d1cc0da Mon Sep 17 00:00:00 2001 From: Angel Perez Date: Fri, 6 Oct 2017 14:46:13 -0400 Subject: [PATCH 4/5] Show answer's title if answer has any records associated If an answer has a description and/or documents/images associated, the answer's title will be shown on the UI so the user can associate a certain answer with its related records See issue #1998, as well as commit 7fad604 --- app/views/polls/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 8347455ae..5dc138f8d 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -74,9 +74,9 @@
- <% if answer.description.present? %> -

<%= answer.title %>

+

<%= answer.title %>

+ <% if answer.description.present? %>
<%= safe_html_with_links simple_format(answer.description) %>
From 5f1485dbfa4342acfb4ca554f68c5cb0b7f8421f Mon Sep 17 00:00:00 2001 From: rgarcia Date: Fri, 6 Oct 2017 22:49:53 +0200 Subject: [PATCH 5/5] fixes specs --- app/views/polls/show.html.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 5dc138f8d..ed64b20f0 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -69,10 +69,10 @@ <% @poll.questions.map(&:question_answers).flatten.each do |answer| %> <% if answer.description.present? || answer.images.any? || answer.documents.present? %>
-
+
+ data-toggler=".medium-6">

<%= answer.title %>