<%- attributes.each do |attribute| -%> <%- if @beautiful_attributes.include?(attribute.name + ':wysiwyg') -%>
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %> <%%= f.text_area :<%= attribute.name %>, :class => "wysiwyg-editor form-control" %>
<%%= f.hidden_field :<%= attribute.name %>_typetext, :value => "html" %> <%- elsif @beautiful_attributes.include?(attribute.name + ':references') -%>
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %> <%%= f.collection_select :<%= attribute.name %>_id, <%= engine_camel.present? ? "#{engine_camel}::" : '' %><%= attribute.name.camelcase %>.all, :id, :caption, { :include_blank => true }, { :class => "form-control" } %>
<%- elsif @beautiful_attributes.include?(attribute.name + ':price') -%>
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
$<%%= f.<%= attribute.field_type %> :<%= attribute.name %>, :class => "form-control" %>
<%- elsif (datetime_field = @beautiful_attributes.include?(attribute.name + ':datetime')) || @beautiful_attributes.include?(attribute.name + ':date') -%>
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %> <% if datetime_field %>
<% end %>
<%%= f.text_field :<%= attribute.name %>, :value => (begin @<%= singular_table_name %>.<%= attribute.name %>.strftime("%d/%m/%Y") rescue "" end), :class => "form-control datetimepicker-input", "data-target" => "#container_<%= singular_table_name %>_<%= attribute.name %>_dp", "data-id" => "<%= singular_table_name %>_<%= attribute.name %>_input_", id: nil %>
<% if datetime_field %>
<%%= f.text_field :<%= attribute.name %>, :value => (begin @<%= singular_table_name %>.<%= attribute.name %>.strftime("%H:%M") rescue "" end), :class => "form-control datetimepicker-input", "data-target" => "#container_<%= singular_table_name %>_<%= attribute.name %>_tp", "data-id" => "<%= singular_table_name %>_<%= attribute.name %>_input_", id: nil %>
<% end %> <%% ["year","mon","day" <%= datetime_field ? ',"min","hour"' : '' %>].each_with_index do |meth, i| %> <%%= f.hidden_field("<%= attribute.name %>(#{i+1}i)", value: @<%= singular_table_name %>.<%= attribute.name %>&.send(meth), id: "<%= singular_table_name %>_<%= attribute.name %>_input_#{i+1}i") %> <%% end %> <% if datetime_field %>
<% end %>
<%- elsif @beautiful_attributes.include?(attribute.name + ':color') -%>
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %>
<%%= f.color_field :<%= attribute.name %>, :class => "form-control" %>
<%- else -%>
<%%= f.label :<%= attribute.name %>, <%= i18n_t_a(singular_table_name, attribute.name) %>.capitalize, :class => "control-label" %> <%%= f.<%= attribute.field_type %> :<%= attribute.name %><%= ', :rows => 5' if attribute.field_type == :text_area %>, :class => "form-control" %>
<%- end -%> <%- end -%>