Extracts list of reasons to a partial

This commit is contained in:
kikito
2017-01-29 22:53:58 +01:00
parent 964da1e6d6
commit b2a43d8450
2 changed files with 25 additions and 24 deletions

View File

@@ -0,0 +1,24 @@
<% if poll.incoming? %>
<div class="callout alert">
<%= t('poll_questions.show.cant_answer_incoming') %>
</div>
<% elsif poll.expired? %>
<div class="callout primary">
<%= t('poll_questions.show.cant_answer_expired') %>
</div>
<% elsif current_user.nil? %>
<div class="callout primary">
<%= 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 %>
</div>
<% elsif current_user.unverified? %>
<div class="callout warning">
<%= t('poll_questions.show.cant_answer_verify_html',
verify_link: link_to(t('poll_questions.show.verify_link'), verification_path)) %>
</div>
<% else %>
<div class="callout warning">
<%= t('poll_questions.show.cant_answer_wrong_geozone') %>
</div>
<% end %>

View File

@@ -54,30 +54,7 @@
%>
</div>
<% else %>
<% if @question.poll.incoming? %>
<div class="callout alert">
<%= t('poll_questions.show.cant_answer_incoming') %>
</div>
<% elsif @question.poll.expired? %>
<div class="callout primary">
<%= t('poll_questions.show.cant_answer_expired') %>
</div>
<% elsif current_user.nil? %>
<div class="callout primary">
<%= 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 %>
</div>
<% elsif current_user.unverified? %>
<div class="callout warning">
<%= t('poll_questions.show.cant_answer_verify_html',
verify_link: link_to(t('poll_questions.show.verify_link'), verification_path)) %>
</div>
<% else %>
<div class="callout warning">
<%= t('poll_questions.show.cant_answer_wrong_geozone') %>
</div>
<% end %>
<%= render 'polls/reasons_for_not_answering', poll: @question.poll %>
<div class="small-12 small-centered text-center column">
<div id="<%= dom_id(@question) %>_answers">