diff --git a/app/assets/stylesheets/participation.scss b/app/assets/stylesheets/participation.scss index 2df8292f6..605afaee8 100644 --- a/app/assets/stylesheets/participation.scss +++ b/app/assets/stylesheets/participation.scss @@ -1574,7 +1574,23 @@ border-bottom: 1px solid #eee; .column:nth-child(odd) { - border-right: 1px solid #eee; + border-right: 2px solid $text; + } + + .answer-divider { + border-bottom: 2px solid $text; + border-right: 0 !important; + margin-bottom: $line-height; + padding-bottom: $line-height; + } + + .answer-description { + height: 100%; + + &.short { + height: $line-height * 12; + overflow: hidden; + } } } @@ -1769,6 +1785,10 @@ margin-right: $line-height / 4; min-width: rem-calc(168); + @include breakpoint(medium down) { + width: 100%; + } + &.answered { background: #f4f8ec; border: 2px solid #92ba48; diff --git a/app/controllers/admin/poll/questions/answers_controller.rb b/app/controllers/admin/poll/questions/answers_controller.rb index 45f0abcd7..511807b10 100644 --- a/app/controllers/admin/poll/questions/answers_controller.rb +++ b/app/controllers/admin/poll/questions/answers_controller.rb @@ -1,5 +1,4 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController - before_action :load_question, except: [:show, :edit, :update] before_action :load_answer, only: [:show, :edit, :update, :documents] load_and_authorize_resource :question, class: "::Poll::Question" @@ -12,7 +11,7 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController @answer = ::Poll::Question::Answer.new(answer_params) if @answer.save - redirect_to admin_question_path(@question), + redirect_to admin_question_path(@answer.question), notice: t("flash.actions.create.poll_question_answer") else render :new @@ -50,8 +49,4 @@ class Admin::Poll::Questions::AnswersController < Admin::Poll::BaseController @answer = ::Poll::Question::Answer.find(params[:id] || params[:answer_id]) end - def load_question - @question = ::Poll::Question.find(params[:question_id]) - end - end diff --git a/app/views/admin/poll/questions/show.html.erb b/app/views/admin/poll/questions/show.html.erb index 123d2ec13..5baabeafe 100644 --- a/app/views/admin/poll/questions/show.html.erb +++ b/app/views/admin/poll/questions/show.html.erb @@ -64,8 +64,9 @@ admin_answer_documents_path(answer) %> - <%= link_to t("admin.questions.show.answers.video_list", - count: answer.videos.count), + (<%= answer.videos.count %>) +
+ <%= link_to t("admin.questions.show.answers.video_list"), admin_answer_videos_path(answer) %> diff --git a/app/views/polls/_gallery.html.erb b/app/views/polls/_gallery.html.erb index d3da43b88..45408c0da 100644 --- a/app/views/polls/_gallery.html.erb +++ b/app/views/polls/_gallery.html.erb @@ -1,6 +1,6 @@
- - + + <%= t("polls.show.zoom_plus") %> @@ -19,7 +19,7 @@ <% answer.images.reverse.each_with_index do |image, index| %>
  • <%= link_to image.attachment.url(:original), target: "_blank" do %> - <%= image_tag image.attachment.url(:large), + <%= image_tag image.attachment.url(:original), class: "orbit-image", alt: image.title %> <% end %> diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index ed64b20f0..e152f888c 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -71,33 +71,57 @@
    -
    + <% @poll.questions.map(&:question_answers).flatten.each do |answer| %> +
    +

    <%= answer.title %>

    -

    <%= answer.title %>

    - - <% if answer.description.present? %> -
    - <%= safe_html_with_links simple_format(answer.description) %> -
    - <% end %> - - <% if answer.images.any? %> - <%= render "gallery", answer: answer %> - <% end %> - - <% if answer.documents.present? %> - <% answer.documents.each do |document| %> - - <%= link_to document.title, - document.attachment.url, - target: "_blank", - rel: "nofollow" %> - + <% if answer.description.present? %> +
    + <%= safe_html_with_links simple_format(answer.description) %> +
    <% end %> - <% end %> -
    + <% if answer.images.any? %> + <%= render "gallery", answer: answer %> + <% end %> + + <% if answer.description.present? %> + + <% end %> + + <% if answer.documents.present? %> + + <% end %> +
    + <% end %>
    <% end %> diff --git a/config/locales/en/admin.yml b/config/locales/en/admin.yml index b16214a2a..442c93727 100644 --- a/config/locales/en/admin.yml +++ b/config/locales/en/admin.yml @@ -602,7 +602,7 @@ en: title: Answer description: Description videos: Videos - video_list: Video list (%{count}) + video_list: Video list images: Images images_list: Images list documents: Documents 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/admin.yml b/config/locales/es/admin.yml index 75fa73dff..5b6393b1b 100644 --- a/config/locales/es/admin.yml +++ b/config/locales/es/admin.yml @@ -602,7 +602,7 @@ es: title: Respuesta description: Descripción videos: Vídeos - video_list: Lista de vídeos (%{count}) + video_list: Lista de vídeos images: Imágenes images_list: Lista de imágenes documents: Documentos 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" diff --git a/config/locales/fr/admin.yml b/config/locales/fr/admin.yml index d80e55fc9..b9cdfcfd3 100644 --- a/config/locales/fr/admin.yml +++ b/config/locales/fr/admin.yml @@ -389,7 +389,7 @@ fr: title: Réponse description: Description videos: Vidéos - video_list: Liste des vidéos (%{count}) + video_list: Liste des vidéos answers: show: title: Titre diff --git a/spec/features/admin/poll/questions/answers/videos/videos_spec.rb b/spec/features/admin/poll/questions/answers/videos/videos_spec.rb index ee04ce128..35d07f454 100644 --- a/spec/features/admin/poll/questions/answers/videos/videos_spec.rb +++ b/spec/features/admin/poll/questions/answers/videos/videos_spec.rb @@ -16,7 +16,7 @@ feature 'Videos' do visit admin_question_path(question) within("#poll_question_answer_#{answer.id}") do - click_link "Video list (#{answer.videos.count})" + click_link "Video list" end click_link "Add video"