Using `<a>` tags with no `href` means these elements cannot be activated by keyboard users, so we're replacing them with buttons. In the future we probably want to add more consistency so all toggle buttons use the same code. We might also add styles depending on the `aria-expanded` property.
126 lines
4.5 KiB
Plaintext
126 lines
4.5 KiB
Plaintext
<%= provide :title, t("social_share.polls_show.title_#{@poll.id}", default: @poll.title) %>
|
|
<%= provide :meta_description, t("social_share.polls_show.description_#{@poll.id}", default: @poll.title) %>
|
|
<%= provide :social_media_meta_tags do %>
|
|
<%= render "shared/social_media_meta_tags",
|
|
social_url: poll_url,
|
|
social_title: t("social_share.polls_show.title_#{@poll.id}", default: @poll.title),
|
|
social_description: t("social_share.polls_show.facebook_#{@poll.id}", default: @poll.title),
|
|
twitter_image_url: "social_media_polls_twitter.jpg",
|
|
og_image_url: "social_media_polls.jpg" %>
|
|
<% end %>
|
|
|
|
<div class="polls-show">
|
|
<%= render "poll_header" %>
|
|
|
|
<%= render "poll_subnav" %>
|
|
|
|
<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 current_user && @poll.voted_in_web?(current_user) && !@poll.expired? %>
|
|
<div class="callout warning">
|
|
<%= t("polls.show.already_voted_in_web") %>
|
|
</div>
|
|
<% end %>
|
|
<% end %>
|
|
|
|
<% @questions.each do |question| %>
|
|
<%= render "polls/questions/question", question: question, token: @token %>
|
|
<% 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>
|
|
<%= auto_link_already_sanitized_html simple_format(@poll.description) %>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<div id="poll_more_info_answers" class="expanded poll-more-info-answers">
|
|
<div class="row padding">
|
|
<% @poll_questions_answers.each do |answer| %>
|
|
<div class="small-12 medium-6 column end answer <%= cycle("first", "") %>" id="answer_<%= answer.id %>">
|
|
<% 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">
|
|
<div id="answer_description_<%= answer.id %>" class="answer-description short" data-toggler="short">
|
|
<%= wysiwyg(answer.description) %>
|
|
</div>
|
|
<div class="read-more">
|
|
<button type="button" id="read_more_<%= answer.id %>"
|
|
data-toggle="answer_description_<%= answer.id %> read_more_<%= answer.id %> read_less_<%= answer.id %>"
|
|
data-toggler="hide">
|
|
<%= t("polls.show.read_more", answer: answer.title) %>
|
|
</button>
|
|
<button type="button" id="read_less_<%= answer.id %>"
|
|
data-toggle="answer_description_<%= answer.id %> read_more_<%= answer.id %> read_less_<%= answer.id %>"
|
|
data-toggler="hide"
|
|
class="hide">
|
|
<%= t("polls.show.read_less", answer: answer.title) %>
|
|
</button>
|
|
</div>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if answer.documents.present? %>
|
|
<div class="document-link">
|
|
<p>
|
|
<span class="icon-document"></span>
|
|
<strong><%= t("polls.show.documents") %></strong>
|
|
</p>
|
|
|
|
<% answer.documents.each do |document| %>
|
|
<%= link_to document.title,
|
|
document.attachment.url,
|
|
target: "_blank",
|
|
rel: "nofollow" %><br>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
|
|
<% if answer.videos.present? %>
|
|
<div class="video-link">
|
|
<p>
|
|
<span class="icon-video"></span>
|
|
<strong><%= t("polls.show.videos") %></strong>
|
|
</p>
|
|
|
|
<% answer.videos.each do |video| %>
|
|
<%= link_to video.title,
|
|
video.url,
|
|
target: "_blank",
|
|
rel: "nofollow" %><br>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
<% end %>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="tabs-content" data-tabs-content="polls_tabs">
|
|
<%= render "filter_subnav" %>
|
|
|
|
<div class="tabs-panel is-active" id="tab-comments">
|
|
<%= render "comments" %>
|
|
</div>
|
|
</div>
|
|
</div>
|