<%= form_for(@question, url: form_url) do |f| %>

  <%= render 'shared/errors', resource: @question %>

  <%= f.hidden_field :proposal_id %>

  <div class="row">

    <div class="small-12 column">
      <div class="small-12 medium-6 large-4">
        <%= f.select :poll_id,
                      options_for_select(Poll.pluck(:name, :id)),
                      prompt: t("admin.questions.index.select_poll"),
                      label: t("admin.questions.new.poll_label") %>
      </div>

      <%= f.text_field :title, maxlength: Poll::Question.title_max_length %>

      <%= f.label :valid_answers %>
      <p class="note"><%= t("admin.questions.new.valid_answers_note") %></p>
      <%= f.text_field :valid_answers, label: false %>


      <%= f.text_area :summary, rows: 4, maxlength: 200 %>

      <div class="ckeditor">
        <%= f.cktext_area :description,
                          maxlength: Poll::Question.description_max_length,
                          ckeditor: { language: I18n.locale } %>
      </div>

      <div class="row">
        <%= f.collection_check_boxes(:geozone_ids, @geozones, :id, :name) do |b| %>
          <div class="small-6 medium-3 column">
            <%= b.label do %>
              <%= b.check_box + b.text %>
            <% end %>
          </div>
        <% end %>
      </div>
      <%# TODO include all link %>

      <div class="row">
        <div class="actions small-12 medium-4 column margin-top">
          <%= f.submit(class: "button expanded", value: t("shared.save")) %>
        </div>
      </div>
    </div>
  </div>

<% end %>