<%= title %>

<%= form.translated :text_field, :title, autofocus: true, class: "js-hashtags", hashtaggable: true %>
<%= render partial: "decidim/decidim_awesome/admin/proposals/editor", locals: { form: form } %>
<% if @form.component_automatic_hashtags.any? %>
<%= form.label :automatic_hashtags %>
<% @form.component_automatic_hashtags.each do |hashtag| %> <% end %>
<% end %> <% if @form.component_suggested_hashtags.any? %>
<%= form.label :suggested_hashtags %>
<%= form.collection_check_boxes :suggested_hashtags, @form.component_suggested_hashtags.map {|hashtag| [hashtag.downcase, "##{hashtag}"]}, :first, :last do |option| option.label { option.check_box(checked: @form.suggested_hashtag_checked?(option.value)) + option.text } end %>
<% end %> <% if @form.meetings %>
<%= form.check_box :created_in_meeting, label: t(".created_in_meeting") %>
<%= form.select :meeting_id, options_for_select(@form.meetings&.map { |meeting| [present(meeting).title, meeting.id] }, selected: meetings_as_authors_selected ), { include_blank: true, label: t(".select_a_meeting") }, { multiple: false, class: "chosen-select" } %>
<% end %> <% if @form.geocoding_enabled? %>
<%= form.geocoding_field :address %>
<% end %> <% if @form.categories&.any? %>
<%= form.categories_select :category_id, @form.categories, include_blank: t(".select_a_category") %>
<% end %> <% if current_component.has_subscopes? %>
<%= scopes_picker_field form, :scope_id, root: current_component.scope %>
<% end %> <% if component_settings.attachments_allowed? %> <%= render partial: "decidim/admin/shared/gallery", locals: { form: form } %> <% end %> <% if component_settings.attachments_allowed? %>
<%= t(".attachment_legend") %> <%= form.fields_for :attachment, @form.attachment do |form| %>
<%= form.text_field :title %>
<%= form.upload :file, optional: false %> <% if params[:id].present? %> <% if proposal.documents.present? %> <%= form.hidden_field :id, value: proposal.documents.first.id %> <%= form.check_box :delete_file, label: t(".delete_attachment"), value: proposal.documents.first.id %> <% end %> <% end %>
<% end %>
<% end %>
<%= javascript_pack_tag "decidim_proposals_admin" %>