<%= simple_form_for ([@site, @section, @content]) do |f| %> <% if display_field?(:category) %>

<%= f.input :category_id, label: "Categoria:", collection: @categories.map { |c| [c.name, c.id] }, input_html: { class: 'js-select2' } %>

<% end %> <% if display_field?(:title) %>

<%= f.input :title, required: true, as: :string, label: 'Título:' %>

<% end %> <% if display_field?(:summary) %>

<%= f.input :summary, as: :text, label: 'Resumo' %>

<% end %> <% if display_field?(:location) %>

<%= f.input :location, as: :string, label: 'Local:' %>

<% end %> <% if display_field?(:date) %> <% field = field_properties(:date) %>

<%= f.input :date, as: (field.format.map(&:to_s).include?("hour") ? :datetime : :date), label: 'Data:', order: field.format, default: @default_date %>

<% end %> <% if display_field?(:tags) %> <% autocomplete = ActsAsTaggableOn::Tag.all.map { |t| {value: t.name, text: t.name} } %> <%= f.input :tag_list, as: :string, required: false, label: "Tags", input_html: { value: f.object.tag_list.join(", "), class: "js-tags", data: { autocomplete: autocomplete.to_json } } %> <% end %> <% if display_field?(:url) %>

<%= f.input :url, label: 'URL:' %>

<% end %> <% if display_field?(:text) %>

<%= f.input :text, as: :text, label: 'Texto', input_html: { class: 'editor' } %>

<% end %> <% if display_field?(:embedded) %>

<%= f.input :embedded, label: 'URL:' %>

<% end %> <% if display_field?(:attachments) %> <%= render 'form_attachments', f: f %> <% end %> <% if display_field?(:images) %> <%= render 'form_images', f: f %> <% end %>
<%= f.submit "Salvar", id: 'submit' %>
<% end %>