Merge pull request #2006 from wairbut-m2c/aperez-admin-polls-adjustments

Adjuments for Poll-related features
This commit is contained in:
Raimond Garcia
2017-10-07 13:10:58 +02:00
committed by GitHub
2 changed files with 38 additions and 21 deletions

View File

@@ -12,13 +12,19 @@
label: t("admin.questions.new.poll_label") %>
</div>
<%= f.text_field :title, maxlength: Poll::Question.title_max_length %>
<%= f.text_field :title %>
<div class="small-12">
<%= f.label :video_url, t("proposals.form.proposal_video_url") %>
<p class="help-text" id="video-url-help-text"><%= t("proposals.form.proposal_video_url_note") %></p>
<%= f.text_field :video_url, placeholder: t("proposals.form.proposal_video_url"), label: false,
aria: {describedby: "video-url-help-text"} %>
<p class="help-text" id="video-url-help-text">
<%= t("proposals.form.proposal_video_url_note") %>
</p>
<%= f.text_field :video_url,
placeholder: t("proposals.form.proposal_video_url"),
label: false,
aria: {describedby: "video-url-help-text"} %>
</div>
<div class="small-12 medium-6 large-4 margin-top">

View File

@@ -66,29 +66,40 @@
</div>
</div>
<div class="expanded poll-more-info-answers">
<div class="row padding">
<% @poll.questions.map(&:question_answers).flatten.each do |answer| %>
<% if answer.description.present? || answer.images.any? || answer.documents.present? %>
<div class="expanded poll-more-info-answers">
<div class="row padding">
<% @poll.questions.map(&:question_answers).flatten.each do |answer| %>
<div class="small-12 medium-6 column end" id="answer_<%= answer.id %>"
<div class="small-12 medium-6 column end" id="answer_<%= answer.id %>"
data-toggler=".medium-6">
<% if answer.description.present? %>
<h3><%= answer.title %></h3>
<% end %>
<% if answer.images.any? %>
<%= render "gallery", answer: answer %>
<% end %>
<% if answer.description.present? %>
<div class="margin-top">
<%= safe_html_with_links simple_format(answer.description) %>
</div>
<% end %>
<% if answer.description.present? %>
<div class="margin-top">
<%= safe_html_with_links simple_format(answer.description) %>
</div>
<% end %>
<% if answer.images.any? %>
<%= render "gallery", answer: answer %>
<% end %>
<% if answer.documents.present? %>
<% answer.documents.each do |document| %>
<tr>
<td><%= link_to document.title,
document.attachment.url,
target: "_blank",
rel: "nofollow" %></td>
</tr>
<% end %>
<% end %>
</div>
</div>
<% end %>
</div>
</div>
</div>
<% end %>
<% end %>
</div>