<%= javascript_include_tag "camaleon_cms/admin/custom_fields_form" %>

<%= @field_group.new_record? ? t('camaleon_cms.admin.settings.new_custom_field_group') : "#{t('camaleon_cms.admin.settings.new_custom_field_group')}: #{@field_group.name} "%>

<%= form_for @field_group, as: "custom_field_group", url:{action: @field_group.new_record? ? :create : :update}, html: {class: 'validate-custom-field cama_ajax_request'} do |f| %>

<%= t('camaleon_cms.admin.settings.details_custom_field_group') %>

<%= render partial: 'layouts/camaleon_cms/admin/form_error', locals: {data: @field_group} %>
<%= f.label t('camaleon_cms.admin.table.name') %>
<%= f.text_field :name, :class => "form-control required" %>
<%= f.label t('camaleon_cms.admin.table.description') %>
<%= f.text_area :description, :class => "form-control" %>
<%= f.label t('camaleon_cms.admin.settings.where_display_group') %>

<%= t('camaleon_cms.admin.settings.fields') %>

<% fields = @field_group.new_record? ? [] : @field_group.fields %>
    <% fields.each do |field| @item_value = field; @item_options_value = field.options; @key = field.options[:field_key] %>
  • <%= render "get_items" %>
  • <% end %>

<%= t('camaleon_cms.admin.settings.available_fields')%>

<% cf_get_items.each do |i,item| %> <% next if item[:key] == "select_eval" %> <%= item[:label] %> <% end %>
<% end %>