<%= form_for(@promotion_attribute, :html => {:id=>"form_promotion_attribute", :class=>"mb-0 form-horizontal", :role => "form", :method => (@promotion_attribute.new_record? ? :post : :put), :remote=>true}) do |f| %>
<%= @promotion_attribute.errors[:base].to_sentence %>
<%= hidden_field_tag "dhatu/promotion_attribute[promotion_id]",(@promotion.try(:id) || params[:pr]) %>
<%= theme_form_field(@promotion_attribute, :name, form_style: "top-bottom") %>
<%= theme_form_group("Data Type", required: true, error_class: "", form_style: "top-bottom") do %> <% options_list = Dhatu::PromotionAttribute::DATA_TYPES %> <%= f.select("data_type", options_for_select(options_list, :selected => @promotion_attribute.data_type), {:prompt=>true}, {:class => 'form-control', :name => "dhatu/promotion_attribute[data_type]"}) %> <% end %>
<%= theme_form_field(@promotion_attribute, :display, required: false, html_options: {type: :checkbox}, form_style: "top-bottom") %>
<%= theme_form_field(@promotion_attribute, :mandatory, required: false, html_options: {type: :checkbox}, form_style: "top-bottom") %>
<%= theme_form_field(@promotion_attribute, :priority, required: false, html_options: {type: :number, style: "width:70px;"}, form_style: "top-bottom") %>
<% display = ["text", "integer", "date", "boolean", ""].include?(@promotion_attribute.data_type.to_s) ? 'none' : '' display = true %> <% @promotion_attribute.set_string_values %>
<%= theme_form_field(@promotion_attribute, :values_string, "data-role": "tagsinput", label: "Data Values", html_options: {class: "kuppayam-tagsinput"}, form_style: "top-bottom") %>
<%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %> <%= link_to raw("Cancel"), "#", onclick: "closeGenericModal();", class: "pull-right ml-10 btn btn-white" %>
<%= clear_tag(10) %> <% end %>