Files
grecia/app/components/polls/questions/read_more_component.html.erb
Javi Martín 219d71baaf Open links to external videos in the same window
Just like we're doing with other external links.

We already mention that it's an external video, so there's no need to
explicitly indicate it in the link.
2023-10-24 16:41:03 +02:00

59 lines
2.0 KiB
Plaintext

<h2><%= question.title %></h2>
<% question.answers_with_read_more.each do |answer| %>
<div class="small-12 medium-6 column end answer <%= cycle("first", "") %>" id="answer_<%= answer.id %>">
<h3><%= answer.title %></h3>
<div class="margin-top">
<% if answer.description.present? %>
<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>
<% end %>
<% if answer.images.any? %>
<%= render "polls/gallery", answer: answer %>
<% end %>
<% if answer.documents.present? %>
<div class="document-link">
<p>
<strong><%= t("polls.show.documents") %></strong>
</p>
<% answer.documents.each do |document| %>
<%= render Documents::DocumentComponent.new(document) %>
<% end %>
</div>
<% end %>
<% if answer.videos.present? %>
<div class="video-link">
<p>
<span class="icon-video"></span>&nbsp;
<strong><%= t("polls.show.videos") %></strong>
</p>
<% answer.videos.each do |video| %>
<%= link_to video.title,
video.url,
rel: "nofollow" %><br>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>