Files
grecia/app/views/polls/show.html.erb
2017-10-06 20:44:47 +02:00

92 lines
2.6 KiB
Plaintext

<% provide :title do %><%= @poll.name %><% end %>
<div class="polls-show">
<div class="expanded no-margin-top polls-show-header">
<div class="row">
<div class="small-12 medium-9 column padding">
<%= back_link_to polls_path, t("polls.show.back") %>
<h2><%= @poll.name %></h2>
<%= safe_html_with_links simple_format(@poll.summary) %>
<% if @poll.geozones.any? %>
<ul class="no-bullet margin-top tags">
<% @poll.geozones.each do |g| %>
<li class="inline-block"><span><%= g.name %></span></li>
<% end %>
</ul>
<% end %>
</div>
<aside class="small-12 medium-3 column margin-top">
<%= render partial: 'shared/social_share', locals: {
share_title: t("shared.share"),
title: @poll.name,
url: poll_url
} %>
</aside>
</div>
</div>
<div class="row margin">
<div class="small-12 medium-9 column">
<%= render "callout" %>
<% if @poll.voted_in_booth?(current_user) %>
<div class="callout warning">
<%= t("polls.show.already_voted_in_booth") %>
</div>
<% else %>
<% if !@poll.voters.find_by_user_id(current_user).present? %>
<div class="callout primary js-token-message" style="display: none">
<%= t('poll_questions.show.voted_token') %>
</div>
<% end %>
<% @questions.each do |question| %>
<%= render 'polls/questions/question', question: question, token: @token %>
<% end %>
<% end %>
</div>
</div>
<div class="expanded poll-more-info">
<div class="row margin">
<div class="small-12 medium-9 column">
<h3><%= t("polls.show.more_info_title") %></h3>
<%= safe_html_with_links simple_format(@poll.description) %>
</div>
<aside class="small-12 medium-3 column">
<div class="sidebar-divider"></div>
<h2><%= t("polls.show.documents") %></h2>
</aside>
</div>
</div>
<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 %>"
data-toggler=".medium-6">
<h3><%= answer.title %></h3>
<% if answer.images.any? %>
<%= render "gallery", answer: answer %>
<% end %>
<div class="margin-top">
<%= safe_html_with_links simple_format(answer.description) %>
</div>
</div>
<% end %>
</div>
</div>
</div>