= admin_inject_enterprise

= form_for @enterprise, url: main_app.register_admin_enterprise_path(@enterprise),
  html: { name: "change_type", id: "change_type", novalidate: true, "ng-app" => "admin.enterprises", "ng-controller"=> 'changeTypeFormCtrl' } do |change_type_form|
  -# Have to use hidden:'true' on this input rather than type:'hidden' as the latter seems to break ngPattern and therefore validation
  %input{ hidden: "true", name: "sells", ng: { required: true, pattern: "/^(none|own|any)$/", model: 'sells', value: "sells"} }

  .row
    .options.sixteen.columns.alpha
      - if @enterprise.is_primary_producer
        .basic_producer.option.one-third.column.alpha
          %a.full-width.button.selector{ ng: { click: "sells='none'", class: "{selected: sells=='none'}" } }
            .top
              %h3= t('.producer_profile')
              %p= t('.connect_ofn')
            .bottom= t('.always_free')
          %p.description
            = t('.producer_description_text')

        .producer_shop.option.one-third.column
          %a.full-width.button.selector{ ng: { click: "sells='own'", class: "{selected: sells=='own'}" } }
            .top
              %h3= t('.producer_shop')
              %p= t('.sell_your_produce')
          %p.description
            = t('.producer_shop_description_text')
            %br
            %br
            = t('.producer_shop_description_text2')

        .full_hub.option.one-third.column.omega
          %a.full-width.button.selector{ ng: { click: "sells='any'", class: "{selected: sells=='any'}" } }
            .top
              %h3= t('.producer_hub')
              %p= t('.producer_hub_text')
          %p.description
            = t('.producer_hub_description_text')

      - else
        .two.columns.alpha
          &nbsp;
        .shop_profile.option.six.columns
          %a.full-width.button.selector{ ng: { click: "sells='none'", class: "{selected: sells=='none'}" } }
            .top
              %h3= t('.profile')
              %p= t('.get_listing')
            .bottom= t('.always_free')
          %p.description
            = t('.profile_description_text')

        .full_hub.option.six.columns
          %a.full-width.button.selector{ ng: { click: "sells='any'", class: "{selected: sells=='any'}" } }
            .top
              %h3= t('.hub_shop')
              %p= t('.hub_shop_text')
          %p.description
            = t('.hub_shop_description_text')
        .two.columns.omega
          &nbsp;

  .row
    .sixteen.columns.alpha
      %span.error{ ng: { show: "(change_type.sells.$error.required || change_type.sells.$error.pattern) && submitted" } }
        = t('.choose_option')
      - if @enterprise.sells == 'unspecified'
        %input.button.big{ type: 'submit', value: t(:select_continue), ng: { click: "submit(change_type)" } }
      - else
        %input.button.big{ type: 'submit', value: t('.change_now'), ng: { click: "submit(change_type)" } }
      %br &nbsp;
      %hr
