.row
  .alpha.eleven.columns
    .three.columns.alpha
      = f.label :name, t('.name')
      %span.required *
    .eight.columns.omega
      = f.text_field :name, { placeholder: t('.name_placeholder') }
- if @groups.present?
  .row
    .alpha.eleven.columns
      .three.columns.alpha
        = f.label :group_ids, t('.groups')
        %div{'ofn-with-tip' => t('.groups_tip')}
          %a= t('admin.whats_this')
      .eight.columns.omega
        = f.collection_select :group_ids, @groups, :id, :name, {}, class: "select2 fullwidth", multiple: true, placeholder: t('.groups_placeholder')

.row
  .three.columns.alpha
    %label= t('.primary_producer')
    %div{'ofn-with-tip' => t('.primary_producer_tip')}
      %a= t('admin.whats_this')
  .five.columns.omega
    = f.check_box :is_primary_producer, 'ng-model' => 'Enterprise.is_primary_producer'
    = f.label :is_primary_producer, t('.producer')
- if spree_current_user.admin?
  .row
    .alpha.eleven.columns
      .three.columns.alpha
        = f.label :sells, t('.sells')
        %div{'ofn-with-tip' => t('.sells_tip')}
          %a= t('admin.whats_this')
      .two.columns
        = f.radio_button :sells, "none", 'ng-model' => 'Enterprise.sells'
        = f.label :sells, t('.none'), value: "none"
      .two.columns
        = f.radio_button :sells, "own", 'ng-model' => 'Enterprise.sells'
        = f.label :sells, t('.own'), value: "own"
      .four.columns.omega
        = f.radio_button :sells, "any", 'ng-model' => 'Enterprise.sells'
        = f.label :sells, t('.any'), value: "any"
.row
  .three.columns.alpha
    %label= t('.visible_in_search')
    %div{'ofn-with-tip' => t('.visible_in_search_tip')}
      %a= t('admin.whats_this')
  .two.columns
    = f.radio_button :visible, true
    = f.label :visible, t('.visible'), value: 'true'
  .five.columns.omega
    = f.radio_button :visible, false
    = f.label :visible, t('.not_visible'), value: 'false'
.permalink{ ng: { controller: "permalinkCtrl" } }
  .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } }
    .three.columns.alpha
      = f.label :permalink, t('.permalink')
      %div{'ofn-with-tip' => t('.permalink_tip', link: main_app.root_url)}
        %a= t('admin.whats_this')
    .six.columns
      = f.text_field :permalink, { 'ng-model' => "Enterprise.permalink", placeholder: "eg. your-shop-name", 'ng-model-options' => "{ updateOn: 'default blur', debounce: {'default': 300, 'blur': 0} }" }
    .two.columns.omega
      %img.spinner{ src: "/assets/spinning-circles.svg", width: "30px", ng: { show: "checking" } }
      %span{ ng: { class: 'availability.toLowerCase()', hide: "checking" } }
        {{ availability }}
        %i{ ng: { class: "{'icon-ok-sign': availability == 'Available', 'icon-remove-sign': availability == 'Unavailable'}" } }
  .row{ ng: { show: "Enterprise.sells == 'own' || Enterprise.sells == 'any'" } }
    .three.columns.alpha
      %label= t('.link_to_front')
      %div{'ofn-with-tip' => t('.link_to_front_tip')}
        %a= t('admin.whats_this')
    .eight.columns.omega
      = surround main_app.root_url, "/shop" do
        {{Enterprise.permalink}}
  .row
    .three.columns.alpha
      = f.label :id, t('.ofn_uid')
      %div{'ofn-with-tip' => t('.ofn_uid_tip')}
        %a= t('admin.whats_this')
    .six.columns
      {{Enterprise.id}}
