From a5d3d5d239486d3d6ccbd5095447a3e4bc8e8325 Mon Sep 17 00:00:00 2001 From: decabeza Date: Sat, 7 Oct 2017 11:53:34 +0200 Subject: [PATCH] adds links to read more and less for answer description --- app/assets/stylesheets/participation.scss | 9 +++++++++ app/views/polls/show.html.erb | 15 ++++++++++++++- config/locales/en/general.yml | 2 ++ config/locales/es/general.yml | 2 ++ 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index ca9f7ab08..b41e2de2f 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -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 { diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 365f6f37c..7686759ca 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -83,7 +83,20 @@ <% if answer.description.present? %>
- <%= safe_html_with_links simple_format(answer.description) %> +
+ <%= safe_html_with_links simple_format(answer.description) %> +
+ + <%= t("polls.show.read_more", answer: answer.title) %> + + + <%= t("polls.show.read_less", answer: answer.title) %> +
<% end %> diff --git a/config/locales/en/general.yml b/config/locales/en/general.yml index 82abea68b..79621ddb5 100644 --- a/config/locales/en/general.yml +++ b/config/locales/en/general.yml @@ -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" diff --git a/config/locales/es/general.yml b/config/locales/es/general.yml index c613e6b40..334090b7b 100644 --- a/config/locales/es/general.yml +++ b/config/locales/es/general.yml @@ -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"