%= render "shared/globalize_locales", resource: @question %>
<%= translatable_form_for(@question, url: form_url) do |f| %>
<%= render "shared/errors", resource: @question %>
<%= f.hidden_field :proposal_id %>
<% if @poll.present? %>
<%= f.hidden_field :poll_id, value: @poll.id %>
<% elsif @question.poll.present? %>
<%= f.hidden_field :poll_id, value: @question.poll.id %>
<% else %>
<% select_options = Poll.all.map { |p| [p.name, p.id] } %>
<%= f.select :poll_id,
options_for_select(select_options),
prompt: t("admin.questions.index.select_poll"),
label: t("admin.questions.new.poll_label") %>
<% end %>
<% if !@question.persisted? %>
<%= fields_for :votation_type do |votation_f| %>
<%= votation_f.select :enum_type,
options_for_select(VotationType.enum_types.map {|k, v| [t(k, scope: :enum_type), v]},
params.dig(:votation_type, :enum_type)), default: 0,
disabled: @question.persisted?, label: t("enum_type.title") %>
<%= t("polls.index.descriptions.unique") %>
<%= votation_f.number_field :max_votes, min: 1, max: 999,
value: params.dig(:votation_type, :max_votes),
label: t("question.max_votes") %>
<%= votation_f.select :prioritization_type,
options_for_select(VotationType.prioritization_types.map {|k, v| [t(k, scope: :prioritization_type), v]},
params.dig(:votation_type, :prioritization_type) ), default: 0,
disabled: @question.persisted?, label: t("prioritization_type.title") %>
<%= votation_f.number_field :max_groups_answers, min: 1, max: 999,
value: params.dig(:votation_type, :max_groups_answers), label: t("question.max_group_answers") %>
<% end %>
<% end %>