<% @item_value = @item_value || {} @item_options_value = @item_options_value || {} @item_id = @item_value[:id] || '' @index = "#{@item_id}_#{Time.now.to_i}" @field_config = cf_get_items[@key.to_sym] colors = ['primary','success','warning','colorful','info','danger'] %>

<%= @item_value[:name]? @item_value[:name] : "#{t('admin.settings.untitled')} #{@field_config[:label]}" %> - <%= @field_config[:label] %> <%= t('admin.settings.field') %>

<%= hidden_field(:fields, :id, index: @index, value: @item_id) %>

<%= text_field(:fields, :name, class: "form-control text-title", index: @index, value: @item_value[:name]? @item_value[:name] : "#{t('admin.settings.untitled')} #{@field_config[:label]}") %>

<%= text_field(:fields, :slug, class: "form-control text-slug", index: @index, value: @item_value[:slug]) %>

<%= text_area(:fields, :description, class: "form-control", index: @index, value: @item_value[:description]) %>
<%= hidden_field(:field_options, :field_key, index: @index, value: @key) %> <%= hidden_field(:field_options, :panel_hidden, index: @index, value: @item_options_value[:panel_hidden], class: 'input-panel-hidden') %> <% html = '' if @field_config[:extra_fields].present? @field_config[:extra_fields].each do |input| type = input[:type] html += "" if input[:label].present? case type when 'select' html += "
" when 'radio' input[:values].each do |val| html += "
" end when 'checkbox' input[:values].each do |val| html += "
" end when 'text_area' html += "#{text_area(:field_options, input[:key], index: @index , value: @item_options_value[input[:key].to_sym] || '', class: 'form-control') }" else html += "#{text_field(:field_options, input[:key], index: @index , value: @item_options_value[input[:key].to_sym] || '', class: 'form-control') }" end end end %>
<%= raw html %>
<% if @field_config[:options][:multiple_options].present? %>
<%= @field_config[:options][:multiple_options][:label] %>
<% if @field_config[:options][:multiple_options][:use_not_default].present? %>
<% end %>
<%= t('admin.button.add_option')%>
<% end %> <% if @field_config[:options][:default_value] %>
<%= text_field(:field_options, 'default_value', index: @index, value: @item_options_value[:default_value], class: 'form-control') %>
<% end %> <% if @field_config[:options][:multiple] || @field_config[:options][:required] || @field_config[:options][:translate] %> <%= t('admin.table.options_field')%> <% end %> <% if @field_config[:options][:multiple] %>
<%= raw html_tooltip(t('admin.table.multiple_field_int'),'right')%>
<% end %> <% if @field_config[:options][:required] %>
<%= raw html_tooltip(t('admin.table.required_field_int'),'right')%>
<% end %> <% if @field_config[:options][:translate] %>
<%= raw html_tooltip(t('admin.table.translate_field_int'),'right')%>
<% end %> <% if false && @field_config[:options][:show_frontend] %>
<%= raw html_tooltip( t('admin.table.show_in_frontend'),'right')%>
<% end %>