<%= form_for(@service, :url => (@service.new_record? ? dhatu.services_path : dhatu.service_path), :method => (@service.new_record? ? :post : :put), :remote => true, :html => {:id=>"form_service", :class=>"mb-0 form-horizontal"}) do |f| %>
<%= @service.errors[:base].to_sentence %>
<%= theme_form_field(@service, :name, required: true, form_style: "top-bottom", html_options: { placeholder: "", "data-id": @service.id.to_s}) %>
<% options = {assoc_collection: Dhatu::Category.filter_by_category_type("Service").published.select("id, name").order("name ASC").all, editable: true, assoc_display_method: :name} %> <%= theme_form_assoc_group(@service, :category_id, label: "Choose Category", form_style: "top-bottom", **options) %>
<%= theme_form_field(@service, :one_liner, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<% if @service.new_record? || @current_user.super_admin? %> <%= theme_form_field(@service, :permalink, form_style: "top-bottom", html_options: { placeholder: ""}) %> <% else %> <%= theme_form_field(@service, :permalink, form_style: "top-bottom", html_options: { placeholder: "", readonly: true}) %> <% end %>
<%= theme_form_field(@service, :description, required: true, html_options: {type: :textarea, class: "form-control wysihtml5", "data-stylesheet-url": "assets/wysiwyg-color.css"}, form_style: "top-bottom") %>
<%= theme_form_field(@service, :price, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<%= theme_form_field(@service, :duration, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<%= theme_form_field(@service, :priority, required: false, form_style: "top-bottom", html_options: { placeholder: "" }) %>
<%= submit_tag("Save", :class=>"btn btn-primary pull-right ml-10") %> <%= link_to raw("Cancel"), "#", onclick: "closeLargeModal();", class: "pull-right btn btn-white" %>
<%= clear_tag %> <% end %>