adds links to read more and less for answer description

This commit is contained in:
decabeza
2017-10-07 11:53:34 +02:00
parent 3ddcb0fd21
commit a5d3d5d239
4 changed files with 27 additions and 1 deletions

View File

@@ -1583,6 +1583,15 @@
margin-bottom: $line-height;
padding-bottom: $line-height;
}
.answer-description {
height: 100%;
&.short {
height: $line-height * 12;
overflow: hidden;
}
}
}
.orbit-bullets button {

View File

@@ -83,7 +83,20 @@
<% if answer.description.present? %>
<div class="margin-top">
<%= safe_html_with_links simple_format(answer.description) %>
<div id="answer_description_<%= answer.id %>" class="answer-description short" data-toggler="short">
<%= safe_html_with_links simple_format(answer.description) %>
</div>
<a 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) %>
</a>
<a 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) %>
</a>
</div>
<% end %>

View File

@@ -492,6 +492,8 @@ en:
more_info_title: "More information"
documents: Documents
zoom_plus: Expand image
read_more: "Read more about %{answer}"
read_less: "Read less about %{answer}"
poll_questions:
create_question: "Create question"
default_valid_answers: "Yes, No"

View File

@@ -492,6 +492,8 @@ es:
more_info_title: "Más información"
documents: Documentación
zoom_plus: Ampliar imagen
read_more: "Leer más sobre %{answer}"
read_less: "Leer menos sobre %{answer}"
poll_questions:
create_question: "Crear pregunta para votación"
default_valid_answers: "Sí, No"