<%- options = [ Fe::OptionGroup.new("Choose One", [ Fe::Option.new("drop-down", "Drop Down"), Fe::Option.new("radio", "Radio Buttons"), Fe::Option.new("rating", "Rating"), Fe::Option.new("acceptance", "Acceptance"), Fe::Option.new("yes-no", "Yes/No"), Fe::Option.new("country", "Country") ]), Fe::OptionGroup.new("Choose Many", [ Fe::Option.new("checkbox", "Checkboxes") ]) ] %>
<%= select_tag "element[style]", option_groups_from_collection_for_select(options, "group", "label", "key", "value", @element.style), onchange: "if(["acceptance", "yes-no"].include($F("element[style]"))) $("choices_section").hide(); else $("choices_section").show();" %>
<%= render "fe/admin/panels/common_fields", f: f %> <% if @element.style == "rating" %> <% %w(before after na).each do |prefix| %>

<% text = prefix == "na" ? "\"Don"t Know\" " : "#{prefix.capitalize} Rating" %> <% label = "(Optional) #{text} Label" %> <%= f.text_field :"rating_#{prefix}_label", maxlength: Fe::Element.max_label_length %>

<% @page.question_sheet.languages.select(&:present?).each do |language| %>

<% translations_hash = @element.send("rating_#{prefix}_label_translations") || {} %> <%= text_field_tag "element[rating_#{prefix}_label_translations][#{language}]", translations_hash[language] %>

<% end %> <% end %> <% end %>
">

Choices
<% showXML = !@element.source.blank? %> Use External XML Feed Manually Enter Choices

<%= f.text_area :content, rows: 6, cols: 80 %>

<% @page.question_sheet.languages.select(&:present?).each do |language| %>

<%= text_area_tag "element[content_translations][#{language}]", @element.content_translations[language], rows: 6, cols: 80 %>

<% end %>

<%= f.check_box :hide_option_labels, class: "inlinecheck" %>

<%= f.text_field :source %>

<%= f.text_field :text_xpath %>

<%= f.text_field :value_xpath %>