.row
  .three.columns.alpha
    = f.label :name, t('admin.enterprises.form.primary_details.name')
    %span.required *
  .nine.columns.omega
    = f.text_field :name, { placeholder: t('admin.enterprises.form.primary_details.name_placeholder'), class: "fullwidth" }

- if spree_current_user.admin?
  .row
    .three.columns.alpha
      =f.label :owner_id, t('.owner')
      %span.required *
      %div{'ofn-with-tip' => t('.owner_tip')}
        %a= t('admin.whats_this')
    .nine.columns.omega
      - owner_email = @enterprise.andand.owner.andand.email || ""
      = f.hidden_field :owner_id, class: "select2 fullwidth", 'user-select' => 'Enterprise.owner'
.row
  .three.columns.alpha
    %label= t('admin.enterprises.form.primary_details.primary_producer')
    %div{'ofn-with-tip' => t('admin.enterprises.form.primary_details.primary_producer_tip')}
      %a= t('admin.whats_this')
  .five.columns.omega
    = f.check_box :is_primary_producer, 'ng-model' => 'Enterprise.is_primary_producer'
    &nbsp;
    = f.label :is_primary_producer, t('.i_am_producer')
- if spree_current_user.admin?
  .row
    .alpha.eleven.columns
      .three.columns.alpha
        = f.label :sells, t('admin.enterprises.form.primary_details.sells')
        %div{'ofn-with-tip' => t('admin.enterprises.form.primary_details.sells_tip')}
          %a What's this?
      .two.columns
        = f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells'
        &nbsp;
        = f.label :sells, t('admin.enterprises.form.primary_details.none'), value: "none"
      .two.columns
        = f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells'
        &nbsp;
        = f.label :sells, t('admin.enterprises.form.primary_details.own'), value: "own"
      .four.columns.omega
        = f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells'
        &nbsp;
        = f.label :sells, t('admin.enterprises.form.primary_details.any'), value: "any"

.row
  .alpha.three.columns
    = f.label :contact_name, t('.contact_name')
  .omega.nine.columns
    = f.text_field :contact_name, { placeholder: t('admin.enterprises.form.contact.name_placeholder')}
.row
  .alpha.three.columns
    = f.label :email_address, t('admin.enterprises.form.contact.email_address')
  .omega.nine.columns
    = f.text_field :email_address, { placeholder: t('admin.enterprises.form.contact.email_address_placeholder'), "ng-model" => "Enterprise.email_address" }
.row
  .alpha.three.columns
    = f.label :phone, t('admin.enterprises.form.contact.phone')
  .omega.nine.columns
    = f.text_field :phone, { placeholder: t('admin.enterprises.form.contact.phone_placeholder')}
.row
  .alpha.three.columns
    = f.label :website, t('admin.enterprises.form.contact.website')
  .omega.nine.columns
    = f.text_field :website, { placeholder: t('admin.enterprises.form.contact.website_placeholder')}

= f.fields_for :address do |af|
  .row
    .three.columns.alpha
      = af.label :address1, t(:address)
      %span.required *
    .nine.columns.omega
      = af.text_field :address1, { placeholder: t(:address_placeholder)}
  .row
    .alpha.three.columns
      = af.label :address2, t(:address2)
    .nine.columns.omega
      = af.text_field :address2
  .row
    .three.columns.alpha
      = af.label :city, t(:city)
      \/
      = af.label :zipcode, t(:postcode)
      %span.required *
    .four.columns
      = af.text_field :city, { placeholder: t(:city_placeholder)}
    .five.columns.omega
      = af.text_field :zipcode, { placeholder: t(:postcode_placeholder)}
  %div{ "ng-controller" => "countryCtrl" }
    .row
      .three.columns.alpha
        = af.label :state_id, t(:state)
        \/
        = af.label :country_id, t(:country)
      .four.columns
        %input.ofn-select2.fullwidth#enterprise_address_attributes_state_id{ name: 'enterprise[address_attributes][state_id]', type: 'number', data: 'countriesById[Enterprise.address.country_id].states', placeholder: t('admin.choose'), ng: { model: 'Enterprise.address.state_id' } }
      .five.columns.omega
        %input.ofn-select2.fullwidth#enterprise_address_attributes_country_id{ name: 'enterprise[address_attributes][country_id]', type: 'number', data: 'countries', placeholder: t('admin.choose'), ng: { model: 'Enterprise.address.country_id' } }

.row
  .twelve.columns.alpha
    &nbsp;
.row
  .twelve.columns.alpha
    = render partial: "spree/admin/shared/new_resource_links"
