% if checkbox_field.hide_option_labels? && !["question_pages", "question_sheets", "elements"].include?(controller.controller_name) %>
|
<% choices = checkbox_field.choices(session[:locale]) %>
<% choices.each_with_index do |choice, num| -%>
<% css_class = checkbox_field.css_class.to_s + " checkbox " -%>
<% dom_id = dom_id(checkbox_field) + "_" + pretty_tag(choice[1])
last_choice = (num == choices.length - 1)
css_class += checkbox_field.validation_class(@answer_sheet, @page) if last_choice
locked = checkbox_field.locked?(params, @answer_sheet, @presenter, current_person)
%>
<%= hidden_field_tag "answers[#{checkbox_field.id}][#{num}]", "", id: "" %>
<%= check_box_tag "answers[#{checkbox_field.id}][#{num}]", choice[1],
checkbox_field.has_answer?(choice[1], @answer_sheet),
id: dom_id,
class: css_class,
disabled: locked,
readonly: locked %>
|
<% end -%>
<% else %>
<% css_class = checkbox_field.css_class.to_s + " checkbox " -%>
<% choices = checkbox_field.choices(session[:locale]) %>
<% choices.each_with_index do |choice, num| -%>
<% dom_id = dom_id(checkbox_field) + "_" + pretty_tag(choice[1])
last_choice = (num == choices.length - 1)
css_class += checkbox_field.validation_class(@answer_sheet, @page) if last_choice
locked = checkbox_field.locked?(params, @answer_sheet, @presenter, current_person)
%>
<%= hidden_field_tag "answers[#{checkbox_field.id}][#{num}]", "", id: "" %>
<%= check_box_tag "answers[#{checkbox_field.id}][#{num}]", choice[1],
checkbox_field.has_answer?(choice[1], @answer_sheet),
id: dom_id,
class: css_class,
disabled: locked,
readonly: locked %>
<% end -%>
<% end %>