diff --git a/app/views/polls/_callout.html.erb b/app/views/polls/_callout.html.erb new file mode 100644 index 000000000..2fad7d07d --- /dev/null +++ b/app/views/polls/_callout.html.erb @@ -0,0 +1,22 @@ +<% unless can?(:answer, @poll) %> + <% if current_user.nil? %> +
+ <%= t("polls.show.cant_answer_not_logged_in", + signin: link_to(t("polls.show.signin"), new_user_session_path, class: "probe-message"), + signup: link_to(t("polls.show.signup"), new_user_registration_path, class: "probe-message")).html_safe %> +
+ <% elsif current_user.unverified? %> +
+ <%= t('polls.show.cant_answer_verify_html', + verify_link: link_to(t('polls.show.verify_link'), verification_path)) %> +
+ <% elsif @poll.incoming? %> +
+ <%= t('polls.show.cant_answer_incoming') %> +
+ <% elsif @poll.expired? %> +
+ <%= t('polls.show.cant_answer_expired') %> +
+ <% end %> +<% end %> diff --git a/app/views/polls/show.html.erb b/app/views/polls/show.html.erb index 63babcfd4..502588944 100644 --- a/app/views/polls/show.html.erb +++ b/app/views/polls/show.html.erb @@ -3,60 +3,52 @@
-
+
<%= render "shared/back_link" %>

<%= @poll.name %>

-
-
-

- <%= t("polls.show.dates_title") %> -

- <%= poll_dates(@poll) %> + <%= t("polls.show.question_count_html", + count: @poll.questions.count) %>

+ + <%= render "callout" %> +
+
+
+

+ + <%= t("polls.show.dates_title") %> + +
+ <%= poll_dates(@poll) %> +

+
-
- <% unless can?(:answer, @poll) %> - <% if current_user.nil? %> -
- <%= t("polls.show.cant_answer_not_logged_in", - signin: link_to(t("polls.show.signin"), new_user_session_path, class: "probe-message"), - signup: link_to(t("polls.show.signup"), new_user_registration_path, class: "probe-message")).html_safe %> -
- <% elsif current_user.unverified? %> -
- <%= t('polls.show.cant_answer_verify_html', - verify_link: link_to(t('polls.show.verify_link'), verification_path)) %> -
- <% elsif @poll.incoming? %> -
- <%= t('polls.show.cant_answer_incoming') %> -
- <% elsif @poll.expired? %> -
- <%= t('polls.show.cant_answer_expired') %> -
- <% end %> - <% end %> - +
<% @answerable_questions.each do |question| %> <%= render 'polls/questions/question', question: question %> <% end %> - - <% if can?(:answer, @poll) && - @non_answerable_questions.present? %> -
- <%= t('polls.show.cant_answer_wrong_geozone') %> -
- <% end %> - - <% @non_answerable_questions.each do |question| %> - <%= render 'polls/questions/question', question: question %> - <% end %>
+ +<% if can?(:answer, @poll) && @non_answerable_questions.present? %> +
+
+
+

+ <%= t("polls.show.cant_answer_wrong_geozone", + count: @non_answerable_questions.count) %> +

+
+ + <% @non_answerable_questions.each do |question| %> + <%= render 'polls/questions/question', question: question %> + <% end %> +
+
+<% end %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 298b33858..38f7d482a 100755 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -398,7 +398,8 @@ en: verify_link: "verify your account" cant_answer_incoming: "This poll has not yet started." cant_answer_expired: "This poll has finished." - cant_answer_wrong_geozone: "The following questions are not available in your geozone." + cant_answer_wrong_geozone: "You can't answers the following %{count} questions because are not available in your geozone." + question_count_html: "This poll has a total of %{count} qeustions." poll_questions: create_question: "Create question" default_valid_answers: "Yes, No" @@ -417,6 +418,7 @@ en: cant_answer_wrong_geozone: "This question is not available on your geozone." vote_answer: "Vote %{answer}" voted: "You have voted %{answer}" + poll: "Poll" banner: featured_title: "#NextVoting" info: "New proposals that have reached the voting phase." diff --git a/config/locales/es.yml b/config/locales/es.yml index 5464efb80..858956f41 100755 --- a/config/locales/es.yml +++ b/config/locales/es.yml @@ -398,7 +398,8 @@ es: verify_link: "verifica tu cuenta" cant_answer_incoming: "Esta votación todavía no ha comenzado." cant_answer_expired: "Esta votación ha terminado." - cant_answer_wrong_geozone: "Esta votación no está disponible en tu zona." + cant_answer_wrong_geozone: "No puedes responder a las siguientes %{count} preguntas porque no están disponibles en tu zona:" + question_count_html: "Esta votación tiene un total de %{count} preguntas." poll_questions: create_question: "Crear pregunta para votación" default_valid_answers: "Sí, No" @@ -417,6 +418,7 @@ es: cant_answer_wrong_geozone: "Esta votación no está disponible en tu zona." vote_answer: "Votar %{answer}" voted: "Has votado %{answer}" + poll: "Votación" banner: featured_title: "#PróximaVotación" info: "Nuevas propuestas ciudadanas han llegado a la fase de votación."