diff --git a/app/views/polls/questions/_answers.html.erb b/app/views/polls/questions/_answers.html.erb index 16d3dcb01..c7effd0c0 100644 --- a/app/views/polls/questions/_answers.html.erb +++ b/app/views/polls/questions/_answers.html.erb @@ -1,46 +1,22 @@
<% if can? :answer, question %> -
- <% question.valid_answers.each do |answer| %> - <% if @answers_by_question_id[question.id] == answer %> - "> - <%= answer %> - - <% else %> - <%= link_to answer, - answer_question_path(question, answer: answer), - method: :post, - remote: true, - title: t("poll_questions.show.vote_answer", answer: answer), - class: "button secondary hollow" %> - <% end %> - <% end %> -
- <% else %> -
- <% if 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)) %> -
+ <% question.valid_answers.each do |answer| %> + <% if @answers_by_question_id[question.id] == answer %> + "> + <%= answer %> + <% else %> -
- <%= t('poll_questions.show.cant_answer_wrong_geozone') %> -
+ <%= link_to answer, + answer_question_path(question, answer: answer), + method: :post, + remote: true, + title: t("poll_questions.show.vote_answer", answer: answer), + class: "button secondary hollow" %> <% end %> -
-
- <% question.valid_answers.each do |answer| %> - <%= answer %> - <% end %> -
-
-
+ <% end %> + <% else %> + <% question.valid_answers.each do |answer| %> + <%= answer %> + <% end %> <% end %> -
\ No newline at end of file + diff --git a/app/views/polls/questions/_question.html.erb b/app/views/polls/questions/_question.html.erb new file mode 100644 index 000000000..b8040c85b --- /dev/null +++ b/app/views/polls/questions/_question.html.erb @@ -0,0 +1,9 @@ +
+

+ <%= link_to question.title, question_path(question) %> +

+ +
+ <%= render 'polls/questions/answers', question: question %> +
+
diff --git a/app/views/polls/questions/show.html.erb b/app/views/polls/questions/show.html.erb index ea6c39c8f..76265797c 100644 --- a/app/views/polls/questions/show.html.erb +++ b/app/views/polls/questions/show.html.erb @@ -1,3 +1,5 @@ +<% provide :title do %><%= @question.title %><% end %> +
@@ -13,31 +15,58 @@

<%= @question.summary %>

-
    +
      <% @question.geozones.each do |g| %> -
    • <%= g.name %>
    • +
    • <%= g.name %>
    • <% end %>

- <%= t('poll_questions.show.author') %>
- <%= link_to @question.author.name, @question.author %> + + <%= t('poll_questions.show.author') %> + +

+

+ <%= link_to @question.author.name, @question.author, class: "margin-bottom" %>

- <%= t('poll_questions.show.dates_title') %>
- <%= poll_dates(@question.poll) %> + + <%= t('poll_questions.show.dates_title') %>

+

<%= poll_dates(@question.poll) %>

<% if @question.poll.current? %> -
+
+
+ <% if 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 "answers", question: @question %> +
+
+ <%= render "answers", question: @question %> +
+
<% elsif @question.poll.incoming? %> <%= t('poll_questions.show.cant_answer_expired') %> @@ -52,6 +81,4 @@
- - <%= render "comments" %>