diff --git a/app/views/polls/_reasons_for_not_answering.html.erb b/app/views/polls/_reasons_for_not_answering.html.erb new file mode 100644 index 000000000..374d319d9 --- /dev/null +++ b/app/views/polls/_reasons_for_not_answering.html.erb @@ -0,0 +1,24 @@ +<% if poll.incoming? %> +
+ <%= t('poll_questions.show.cant_answer_incoming') %> +
+<% elsif poll.expired? %> +
+ <%= t('poll_questions.show.cant_answer_expired') %> +
+<% elsif current_user.nil? %> +
+ <%= t("poll_questions.show.not_logged_in", + signin: link_to(t("poll_questions.show.signin"), new_user_session_path, class: "probe-message"), + signup: link_to(t("poll_questions.show.signup"), new_user_registration_path, class: "probe-message")).html_safe %> +
+<% elsif current_user.unverified? %> +
+ <%= t('poll_questions.show.cant_answer_verify_html', + verify_link: link_to(t('poll_questions.show.verify_link'), verification_path)) %> +
+<% else %> +
+ <%= t('poll_questions.show.cant_answer_wrong_geozone') %> +
+<% end %> diff --git a/app/views/polls/questions/show.html.erb b/app/views/polls/questions/show.html.erb index c04490f7d..f743d89a9 100644 --- a/app/views/polls/questions/show.html.erb +++ b/app/views/polls/questions/show.html.erb @@ -54,30 +54,7 @@ %> <% else %> - <% if @question.poll.incoming? %> -
- <%= t('poll_questions.show.cant_answer_incoming') %> -
- <% elsif @question.poll.expired? %> -
- <%= t('poll_questions.show.cant_answer_expired') %> -
- <% elsif current_user.nil? %> -
- <%= t("poll_questions.show.not_logged_in", - signin: link_to(t("poll_questions.show.signin"), new_user_session_path, class: "probe-message"), - signup: link_to(t("poll_questions.show.signup"), new_user_registration_path, class: "probe-message")).html_safe %> -
- <% elsif current_user.unverified? %> -
- <%= t('poll_questions.show.cant_answer_verify_html', - verify_link: link_to(t('poll_questions.show.verify_link'), verification_path)) %> -
- <% else %> -
- <%= t('poll_questions.show.cant_answer_wrong_geozone') %> -
- <% end %> + <%= render 'polls/reasons_for_not_answering', poll: @question.poll %>