Change the rendering order of answer additional information

This commit is contained in:
decabeza
2022-09-01 12:48:53 +02:00
committed by Senén Rodero Rodríguez
parent 4fba76f64f
commit e44fe7634a

View File

@@ -3,12 +3,8 @@
<div class="small-12 medium-6 column end answer <%= cycle("first", "") %>" id="answer_<%= answer.id %>">
<h3><%= answer.title %></h3>
<% if answer.images.any? %>
<%= render "polls/gallery", answer: answer %>
<% end %>
<% if answer.description.present? %>
<div class="margin-top">
<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>
@@ -25,39 +21,43 @@
<%= t("polls.show.read_less", answer: answer.title) %>
</button>
</div>
</div>
<% end %>
<% end %>
<% if answer.documents.present? %>
<div class="document-link">
<p>
<span class="icon-document"></span>&nbsp;
<strong><%= t("polls.show.documents") %></strong>
</p>
<% if answer.images.any? %>
<%= render "polls/gallery", answer: answer %>
<% end %>
<% answer.documents.each do |document| %>
<%= link_to document.title,
document.attachment,
target: "_blank",
rel: "nofollow" %><br>
<% end %>
</div>
<% end %>
<% if answer.documents.present? %>
<div class="document-link">
<p>
<span class="icon-document"></span>&nbsp;
<strong><%= t("polls.show.documents") %></strong>
</p>
<% if answer.videos.present? %>
<div class="video-link">
<p>
<span class="icon-video"></span>&nbsp;
<strong><%= t("polls.show.videos") %></strong>
</p>
<% answer.documents.each do |document| %>
<%= link_to document.title,
document.attachment,
target: "_blank",
rel: "nofollow" %><br>
<% end %>
</div>
<% end %>
<% answer.videos.each do |video| %>
<%= link_to video.title,
video.url,
target: "_blank",
rel: "nofollow" %><br>
<% 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,
target: "_blank",
rel: "nofollow" %><br>
<% end %>
</div>
<% end %>
</div>
</div>
<% end %>