<%= form_for(@product, :url => (@product.new_record? ? dhatu.products_path : dhatu.product_path), :method => (@product.new_record? ? :post : :put), :remote => true, :html => {:id=>"form_product", :class=>"mb-0 form-horizontal"}) do |f| %>
<%= @product.errors[:base].to_sentence %>
<%= theme_form_field(@product, :title, required: true, form_style: "top-bottom", html_options: { placeholder: "", "data-id": @product.id.to_s}) %> <%= theme_form_field(@product, :sub_title, required: true, form_style: "top-bottom", html_options: { placeholder: "", "data-id": @product.id.to_s}) %>
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("Dhatu::Product").published.select("id, name").order("priority ASC, name ASC").all, editable: true, assoc_display_method: :name, required: false, include_blank: true} %> <%= theme_form_assoc_group(@product, :category_id, label: "Choose Category", form_style: "top-bottom", **options) %>
<%= theme_form_field(@product, :ean_sku, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<%= theme_form_field(@product, :reference_number, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<% options = {assoc_collection: Dhatu::Manufacturer.published.select("id, name").order("priority ASC, name ASC").all, editable: true, assoc_display_method: :name, required: false, include_blank: true} %> <%= theme_form_assoc_group(@product, :manufacturer_id, label: "Choose Manufacturer", form_style: "top-bottom", **options) %>
<%= theme_form_field(@product, :price, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<%= theme_form_field(@product, :priority, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<%= theme_form_field(@product, :short_description, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %> <%= theme_form_field(@product, :description, required: true, html_options: {type: :textarea, class: "form-control wysihtml5", "data-stylesheet-url": "assets/wysiwyg-color.css"}, form_style: "top-bottom") %>
<%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %> <%= link_to raw("Cancel"), "#", onclick: close_form_modal, class: "pull-right btn btn-white" %>
<%= clear_tag %> <% end %>