%h2= t("captions.backend/users.#{action_name}")

= simple_form_for [:backend, current_object] do |f|
  = f.input :name, required: true
  = f.input :login_name, required: true
  = f.input :email, required: true
  = f.input :join_date,  as: :string, required: true, wrapper_html: { class: 'date-input' },
    input_html: { data: { input: 'datepicker', format: 'Y/m/d' } }
  = f.input :leave_date, as: :string, wrapper_html: { class: 'date-input' },
    input_html: { data: { input: 'datepicker', format: 'Y/m/d' } }
  - if %w[new create].include? action_name
    = f.input :assign_leave_time, as: :boolean
    = f.input :assign_date, wrapper_html: { class: 'date-input' },
      input_html: { data: { input: 'datepicker', format: 'Y/m/d' } }

  = f.input :role, collection: User.enum_attributes_for_select(:roles), include_blank: false
  = f.button :submit

%h2= t("captions.backend/users.#{action_name}")

= simple_form_for [:backend, current_object] do |f|
  = f.input :name, required: true
  = f.input :login_name, required: true
  = f.input :email, required: true
  = f.input :join_date,  as: :string, required: true, wrapper_html: { class: 'date-input' },
    input_html: { data: { input: 'datepicker', format: 'Y/m/d' } }
  = f.input :leave_date, as: :string, wrapper_html: { class: 'date-input' },
    input_html: { data: { input: 'datepicker', format: 'Y/m/d' } }
  = f.input :assign_leave_time, as: :boolean
  = f.input :assign_date, wrapper_html: { class: 'date-input' },
    input_html: { data: { input: 'datepicker', format: 'Y/m/d' } }
  = f.input :role, collection: User.enum_attributes_for_select(:roles), include_blank: false
  = f.button :submit

Allow assign leave time when edit user
Allow assign leave time when edit user
