.row
  .eleven.columns.alpha
    = f.label "enterprise_preferred_shopfront_message", t('.shopfront_message')
    = f.hidden_field :preferred_shopfront_message, id: "enterprise_preferred_shopfront_message"
    %trix-editor{ input: "enterprise_preferred_shopfront_message", "data-controller": "trixeditor", placeholder: t('.shopfront_message_placeholder') }
.row
  .eleven.columns.alpha
    = f.label "enterprise_preferred_shopfront_closed_message", t('.shopfront_closed_message')
    = f.hidden_field :preferred_shopfront_closed_message, id: "enterprise_preferred_shopfront_closed_message"
    %trix-editor{ input: "enterprise_preferred_shopfront_closed_message", "data-controller": "trixeditor", placeholder: t('.shopfront_closed_message_placeholder') }

.row
  .text-normal
    = t('.display_ordering_in_shopfront')
    %br
    = t('.shopfront_category_ordering_note')
.row
  .three.columns.alpha
    = radio_button :enterprise, :preferred_shopfront_product_sorting_method, :by_category, { 'ng-model' => 'Enterprise.preferred_shopfront_product_sorting_method' }
    = label :enterprise, :preferred_shopfront_product_sorting_method_by_category, t('.shopfront_sort_by_category')
  .eight.columns.omega
    %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_taxon_order', name: 'enterprise[preferred_shopfront_taxon_order]', rows: 6, "ofn-taxon-autocomplete": '', "multiple-selection": 'true', placeholder: t('.shopfront_sort_by_category_placeholder'), "ng-model": 'Enterprise.preferred_shopfront_taxon_order', "ng-readonly": "Enterprise.preferred_shopfront_product_sorting_method != 'by_category'" }
.row
  .three.columns.alpha
    = radio_button :enterprise, :preferred_shopfront_product_sorting_method, :by_producer, { 'ng-model' => 'Enterprise.preferred_shopfront_product_sorting_method' }
    = label :enterprise, :preferred_shopfront_product_sorting_method_by_producer, t('.shopfront_sort_by_producer')
  .eight.columns.omega
    %textarea.fullwidth{ id: 'enterprise_preferred_shopfront_producer_order', name: 'enterprise[preferred_shopfront_producer_order]', rows: 6, "ofn-producer-autocomplete": '', "multiple-selection": 'true', placeholder: t('.shopfront_sort_by_producer_placeholder'), "ng-model": 'Enterprise.preferred_shopfront_producer_order', "ng-readonly": "Enterprise.preferred_shopfront_product_sorting_method != 'by_producer'" }

.row
  .three.columns.alpha
    = f.label "enterprise_preferred_shopfront_order_cycle_order", t(:sort_order_cycles_on_shopfront_by)
  .three.columns
    = radio_button :enterprise, :preferred_shopfront_order_cycle_order, :orders_open_at, { 'ng-model' => 'Enterprise.preferred_shopfront_order_cycle_order' }
    = label :enterprise, :preferred_shopfront_order_cycle_order_orders_open_at, t('.open_date')
  .five.columns.omega
    = radio_button :enterprise, :preferred_shopfront_order_cycle_order, :orders_close_at, { 'ng-model' => 'Enterprise.preferred_shopfront_order_cycle_order' }
    = label :enterprise, :preferred_shopfront_order_cycle_order_orders_close_at, t('.close_date')
.row
  .three.columns.alpha
    %label= t '.shopfront_requires_login'
    %div{'ofn-with-tip' => t('.shopfront_requires_login_tip')}
      %a= t 'admin.whats_this'
  .three.columns
    = f.radio_button :require_login, false, "ng-model" => "Enterprise.require_login", "ng-value" => "false"
    = f.label :require_login, t('.shopfront_requires_login_false'), value: :false
  .five.columns.omega
    = f.radio_button :require_login, true, "ng-model" => "Enterprise.require_login", "ng-value" => "true"
    = f.label :require_login, t('.shopfront_requires_login_true'), value: :true

.row{ "ng-if": "!Enterprise.require_login" }
  .three.columns.alpha
    %label= t '.allow_guest_orders'
    %div{'ofn-with-tip' => t('.allow_guest_orders_tip')}
      %a= t 'admin.whats_this'
  .three.columns
    = f.radio_button :allow_guest_orders, true, "ng-model" => "Enterprise.allow_guest_orders", "ng-value" => "true"
    = f.label :allow_guest_orders, t('.allow_guest_orders_true'), value: :true
  .five.columns.omega
    = f.radio_button :allow_guest_orders, false, "ng-model" => "Enterprise.allow_guest_orders", "ng-value" => "false"
    = f.label :allow_guest_orders, t('.allow_guest_orders_false'), value: :false
  .row.warning{ "ng-show": 'Enterprise.allow_guest_orders && Enterprise.allow_order_changes' }
    .eight.columns.alpha.omega
      %i.icon-warning-sign
      = t '.recommend_require_login'

.row
  .three.columns.alpha
    %label= t '.display_remaining_stock'
    %div{'ofn-with-tip' => t('.display_remaining_stock_tip')}
      %a= t 'admin.whats_this'
  .three.columns
    = f.radio_button :preferred_product_low_stock_display, true, 'ng-model' => 'Enterprise.preferred_product_low_stock_display', 'ng-value' => 'true'
    = f.label :preferred_product_low_stock_display, t('.enabled'), value: :true
  .five.columns.omega
    = f.radio_button :preferred_product_low_stock_display, false, 'ng-model' => 'Enterprise.preferred_product_low_stock_display', 'ng-value' => 'false'
    = f.label :preferred_product_low_stock_display, t('.disabled'), value: :false

.row
  .three.columns.alpha
    %label= t '.allow_order_changes'
    %div{'ofn-with-tip' => t('.allow_order_changes_tip')}
      %a= t 'admin.whats_this'
  .three.columns
    = f.radio_button :allow_order_changes, false, "ng-model" => "Enterprise.allow_order_changes", "ng-value" => "false"
    = f.label :allow_order_changes, t('.allow_order_changes_false'), value: :false
  .five.columns.omega
    = f.radio_button :allow_order_changes, true, "ng-model" => "Enterprise.allow_order_changes", "ng-value" => "true"
    = f.label :allow_order_changes, t('.allow_order_changes_true'), value: :true

.row
  .three.columns.alpha
    %label= t '.enable_subscriptions'
    %div{'ofn-with-tip' => t('.enable_subscriptions_tip')}
      %a= t 'admin.whats_this'
  .three.columns
    = f.radio_button :enable_subscriptions, true
    = f.label :enable_subscriptions, t('.enable_subscriptions_true'), value: :true
  .five.columns.omega
    = f.radio_button :enable_subscriptions, false
    = f.label :enable_subscriptions, t('.enable_subscriptions_false'), value: :false

.row
  .three.columns.alpha
    %label= t '.customer_names_in_reports'
    %div{'ofn-with-tip' => t('.customer_names_tip')}
      %a= t 'admin.whats_this'
  .three.columns
    = f.radio_button :show_customer_names_to_suppliers, true
    = f.label :show_customer_names_to_suppliers, t('.customer_names_true'), value: :true
  .five.columns.omega
    = f.radio_button :show_customer_names_to_suppliers, false
    = f.label :show_customer_names_to_suppliers, t('.customer_names_false'), value: :false

.row
  .three.columns.alpha
    %label= t '.customer_contacts_in_reports'
    %div{'ofn-with-tip' => t('.customer_contacts_tip')}
      %a= t 'admin.whats_this'
  .three.columns
    = f.radio_button :show_customer_contacts_to_suppliers, true
    = f.label :show_customer_contacts_to_suppliers, t('.customer_contacts_true'), value: :true
  .five.columns.omega
    = f.radio_button :show_customer_contacts_to_suppliers, false
    = f.label :show_customer_contacts_to_suppliers, t('.customer_contacts_false'), value: :false
