Rename variables describing poll options as answers
Since we've renamed the class to `Option`, having variables, methods and texts refering to it as `answer` was confusing.
This commit is contained in:
@@ -26,7 +26,7 @@
|
||||
</td>
|
||||
<td>
|
||||
<%= render Admin::TableActionsComponent.new(question) do |actions| %>
|
||||
<%= actions.action(:answers, text: t("admin.polls.show.edit_answers")) %>
|
||||
<%= actions.action(:options, text: t("admin.polls.show.edit_answers")) %>
|
||||
<% end %>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -71,30 +71,30 @@
|
||||
</thead>
|
||||
|
||||
<tbody class="sortable" data-js-url="<%= admin_question_options_order_options_path(@question.id) %>">
|
||||
<% @question.question_options.each do |answer| %>
|
||||
<tr id="<%= dom_id(answer) %>" class="poll_question_answer" data-answer-id="<%= answer.id %>">
|
||||
<td class="align-top"><%= answer.title %></td>
|
||||
<td class="align-top break"><%= wysiwyg(answer.description) %></td>
|
||||
<% @question.question_options.each do |option| %>
|
||||
<tr id="<%= dom_id(option) %>" class="poll_question_answer" data-answer-id="<%= option.id %>">
|
||||
<td class="align-top"><%= option.title %></td>
|
||||
<td class="align-top break"><%= wysiwyg(option.description) %></td>
|
||||
<td class="align-top text-center">
|
||||
(<%= answer.images.count %>)
|
||||
(<%= option.images.count %>)
|
||||
<br>
|
||||
<%= link_to t("admin.questions.show.answers.images_list"),
|
||||
admin_option_images_path(answer) %>
|
||||
admin_option_images_path(option) %>
|
||||
</td>
|
||||
<td class="align-top text-center">
|
||||
(<%= answer.documents.count rescue 0 %>)
|
||||
(<%= option.documents.count rescue 0 %>)
|
||||
<br>
|
||||
<%= link_to t("admin.questions.show.answers.documents_list"),
|
||||
admin_option_documents_path(answer) %>
|
||||
admin_option_documents_path(option) %>
|
||||
</td>
|
||||
<td class="align-top text-center">
|
||||
(<%= answer.videos.count %>)
|
||||
(<%= option.videos.count %>)
|
||||
<br>
|
||||
<%= link_to t("admin.questions.show.answers.video_list"),
|
||||
admin_option_videos_path(answer) %>
|
||||
admin_option_videos_path(option) %>
|
||||
</td>
|
||||
<td>
|
||||
<%= render Admin::Poll::Questions::Options::TableActionsComponent.new(answer) %>
|
||||
<%= render Admin::Poll::Questions::Options::TableActionsComponent.new(option) %>
|
||||
</td>
|
||||
</tr>
|
||||
<% end %>
|
||||
|
||||
@@ -13,8 +13,8 @@
|
||||
</div>
|
||||
|
||||
<div class="js-answers">
|
||||
<%= f.fields_for :question_options do |answer| %>
|
||||
<%= render "question_option_fields", f: answer %>
|
||||
<%= f.fields_for :question_options do |option_form| %>
|
||||
<%= render "question_option_fields", f: option_form %>
|
||||
<% end %>
|
||||
|
||||
<div class="answer-links links row expanded">
|
||||
|
||||
@@ -16,9 +16,9 @@
|
||||
<div class="small-12 column">
|
||||
<h3><%= question.title %></h3>
|
||||
</div>
|
||||
<% question.question_options.each_with_index do |answer, i| %>
|
||||
<% question.question_options.each_with_index do |option, i| %>
|
||||
<div class="small-12 medium-6 large-3 column end">
|
||||
<label><%= answer.title %></label>
|
||||
<label><%= option.title %></label>
|
||||
<%= text_field_tag "questions[#{question.id}][#{i}]", answer_result_value(question.id, i), placeholder: "0" %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="orbit margin-bottom" role="region" aria-label="<%= answer.title %>" data-orbit data-auto-play="false" data-use-m-u-i="false">
|
||||
<button type="button" data-toggle="answer_<%= answer.id %> zoom_<%= answer.id %>" class="zoom-link hide-for-small-only">
|
||||
<span id="zoom_<%= answer.id %>" class="icon-search-plus" data-toggler="icon-search-plus icon-search-minus"></span>
|
||||
<div class="orbit margin-bottom" role="region" aria-label="<%= option.title %>" data-orbit data-auto-play="false" data-use-m-u-i="false">
|
||||
<button type="button" data-toggle="answer_<%= option.id %> zoom_<%= option.id %>" class="zoom-link hide-for-small-only">
|
||||
<span id="zoom_<%= option.id %>" class="icon-search-plus" data-toggler="icon-search-plus icon-search-minus"></span>
|
||||
<span class="show-for-sr"><%= t("polls.show.zoom_plus") %></span>
|
||||
</button>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</button>
|
||||
</li>
|
||||
|
||||
<% answer.images.reverse.each_with_index do |image, index| %>
|
||||
<% option.images.reverse.each_with_index do |image, index| %>
|
||||
<li class="orbit-slide <%= is_active_class(index) %>">
|
||||
<%= link_to image.attachment do %>
|
||||
<%= image_tag image.attachment,
|
||||
@@ -30,7 +30,7 @@
|
||||
</ul>
|
||||
|
||||
<nav class="orbit-bullets">
|
||||
<% answer.images.each_with_index do |image, index| %>
|
||||
<% option.images.each_with_index do |image, index| %>
|
||||
<button class="<%= is_active_class(index) %>" data-slide="<%= index %>">
|
||||
<span class="show-for-sr"><%= image.title.unicode_normalize %></span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user