<commit_before>%ul.nav.nav-tabs
  %li.active
    %a{:href => '#required', :data =>{:toggle => 'tab'}}
      Required Fields
  %li
    %a{:href => '#recommended', :data =>{:toggle => 'tab'}}
      Recommended Fields

= simple_form_for(@asset,
  :as => :asset,
  :url => inventory_index_path,
  :method => 'post',
  :html => {:class => 'form-vertical'},
  :wrapper => :vertical_form,
  :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes,
    :radio_buttons => :vertical_radio_and_checkboxes,
    :file => :vertical_file_input,
    :boolean => :vertical_boolean}) do |f|

  .tab-content.form-section
    .tab-pane.fade.in.active#required
      .col-sm-6
        
        %h2.form-section-header
          Organization

        = f.association :organization, collection: TransitOperator.where(id: @asset.organization_id)

        
        %h2.form-section-header
          Service Status

        = f.simple_fields_for :service_status_updates, @asset.service_status_updates.build do |update_event|
          = update_event.input :service_status_type_id, collection: ServiceStatusType.active, label: 'Service Status'


        %h2.form-section-header
          Funding

        .form-group.required.radio-buttons-inline
          %label.required.control-label
            %abbr{title: 'required'} *
            = " Direct Capital Responsibility"
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'yes', @asset.direct_capital_responsibility
              Yes
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'no', !@asset.direct_capital_responsibility
              No

        = f.input :pcnt_capital_responsibility, :required => @asset.direct_capital_responsibility, :wrapper => :vertical_append, :label => "Percent Capital Responsibility" do
          = f.input_field :pcnt_capital_responsibility, :class => 'form-control', :required => @asset.direct_capital_responsibility, :disabled => !@asset.direct_capital_responsibility, :min => 1
          %span.input-group-addon %

        = f.association :shared_capital_responsibility_organization, collection: Organization.all, label: 'Organization with Shared Capital Responsibility', required: true



        %h2.form-section-header
          Operations

        = f.input :max_permissible_speed, label: 'Maximum Permissible Speed', required: true

        = f.input :max_permissible_speed_unit, label: 'Unit', required: true

        = f.input :primary_fta_mode_type_id, collection: FtaModeType.active, label: 'Primary Mode', required: true
        
        = f.input :primary_fta_service_type_id, collection: FtaServiceType.active, label: 'Service Type (Primary Mode)', required: true

      .col-sm-6

        %h2.form-section-header
          Identification & Classification

        = f.input :asset_tag, label: 'Asset/Segment ID'

        = f.input :description, label: 'Description/Segment Name'

        .form-row-group

          .col-lg-5.row-col.left-col.clearfix.add-colon-parent

            = f.input :from_line, required: true, label: 'Line', wrapper_class: 'col-xs-4 row-col left-col'

            = f.input :from_segment, required: true, label: 'From', wrapper_class: 'col-xs-8 row-col right-col add-colon'

          .col-lg-5.row-col.middle-col.clearfix

            = f.input :to_line, required: true, label: 'Line', wrapper_class: 'col-xs-4 row-col left-col'

            = f.input :to_segment, required: true, label: 'To', wrapper_class: 'col-xs-8 row-col right-col'

          .col-lg-2.row-col.right-col.clearfix

            = f.input :segment_unit, required: true, label: 'Unit', wrapper_class: 'row-col'



  .form-actions.form-section
    = f.button :submit, '+ Add Asset & Go to New Record', :class => 'btn btn-primary'


  %hr
  = f.input :from_line
  = f.input :from_segment
  
  = f.input :to_segment
  = f.input :segment_unit
  = f.association :infrastructure_segment_unit_type, collection: InfrastructureSegmentUnitType.active
  = f.association :infrastructure_chain_type, collection: InfrastructureChainType.active
  = f.input :from_location_name
  = f.input :to_location_name
  = f.input :relative_location
  = f.input :relative_location_unit
  = f.input :relative_location_direction
  = f.input :asset_tag
  = f.input :external_id
  
  = f.input :location_name
  = f.input :fta_asset_category_id, as: :hidden, input_html: {value: @asset.fta_asset_class.fta_asset_category_id}
  = f.association :fta_asset_class
  = f.input :global_fta_type, :collection => FtaGuidewayType.all.map{|f| [ f.to_s, f.to_global_id ]}, required: true
  = f.association :asset_subtype
  = f.association :infrastructure_segment_type, collection: InfrastructureSegmentType.active.where(fta_asset_class: @asset.fta_asset_class) # need to add JS to hide based on subtype selected
  = f.association :infrastructure_division, collection: InfrastructureDivision.active.where(organization_id: @asset.organization_id)
  = f.association :infrastructure_subdivision, collection: InfrastructureSubdivision.active.where(organization_id: @asset.organization_id)
  = f.input :num_tracks

  %fieldset
    %legend Length
    = f.input :length
    = f.input :length_unit

  %fieldset
    %legend Minimum Vertical Clearance
    = f.input :height
    = f.input :height_unit

  %fieldset
    %legend Minimum Horizontal Clearance
    = f.input :width
    = f.input :width_unit

  = f.input :pcnt_capital_responsibility
  = f.association :shared_capital_responsibility_organization, collection: Organization.all

  = f.input :primary_fta_mode_type_id
  = f.input :primary_fta_service_type_id
  = f.input :nearest_city
  = f.input :nearest_state

  = f.association :land_ownership_organization
  = f.input :other_land_ownership_organization
  = f.association :title_ownership_organization, label: 'Infrastructure Owner'
  = f.input :other_title_ownership_organization, label: 'Infrastructure Owner (Other)'

  = f.simple_fields_for :condition_updates, @asset.condition_updates.build do |update_event|
    = update_event.input :assessed_rating

  = f.simple_fields_for :service_status_updates, @asset.service_status_updates.build do |update_event|
    = update_event.input :service_status_type_id, collection: ServiceStatusType.active
    = update_event.input :fta_emergency_contingency_fleet

  %ul.nav.nav-tabs
    - ComponentType.where(fta_asset_category: @asset.fta_asset_class.fta_asset_category, fta_asset_class: @asset.fta_asset_class).each do |component_type|
      %li
        %a{:href => "##{component_type}", :data =>{:toggle => 'tab'}}
          = component_type


  .tab-content
    - ComponentType.where(fta_asset_category: @asset.fta_asset_class.fta_asset_category, fta_asset_class: @asset.fta_asset_class).each do |component_type|
      .tab-pane.fade{id: component_type.to_s}
        .tab-content
          - component_element_types = ComponentElementType.where(component_type: component_type)
          - if component_element_types.count > 0
            - component_element_types.each do |component_element_type|
              %fieldset
                %legend= component_element_type
                - nested_id = "component_element_type_#{component_element_type.id}"<commit_msg>add missinf fields to new form infrastructure guideway TTPLAT-25<commit_after>%ul.nav.nav-tabs
  %li.active
    %a{:href => '#required', :data =>{:toggle => 'tab'}}
      Required Fields
  %li
    %a{:href => '#recommended', :data =>{:toggle => 'tab'}}
      Recommended Fields

= simple_form_for(@asset,
  :as => :asset,
  :url => inventory_index_path,
  :method => 'post',
  :html => {:class => 'form-vertical'},
  :wrapper => :vertical_form,
  :wrapper_mappings => {:check_boxes => :vertical_radio_and_checkboxes,
    :radio_buttons => :vertical_radio_and_checkboxes,
    :file => :vertical_file_input,
    :boolean => :vertical_boolean}) do |f|

  .tab-content.form-section
    .tab-pane.fade.in.active#required
      .col-sm-6
        
        %h2.form-section-header
          Organization

        = f.association :organization, collection: TransitOperator.where(id: @asset.organization_id)

        
        %h2.form-section-header
          Service Status

        = f.simple_fields_for :service_status_updates, @asset.service_status_updates.build do |update_event|
          = update_event.input :service_status_type_id, collection: ServiceStatusType.active, label: 'Service Status'


        %h2.form-section-header
          Funding

        .form-group.required.radio-buttons-inline
          %label.required.control-label
            %abbr{title: 'required'} *
            = " Direct Capital Responsibility"
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'yes', @asset.direct_capital_responsibility
              Yes
          %span.radio
            %label
              = radio_button_tag :direct_capital_responsibility, 'no', !@asset.direct_capital_responsibility
              No

        = f.input :pcnt_capital_responsibility, :required => @asset.direct_capital_responsibility, :wrapper => :vertical_append, :label => "Percent Capital Responsibility" do
          = f.input_field :pcnt_capital_responsibility, :class => 'form-control', :required => @asset.direct_capital_responsibility, :disabled => !@asset.direct_capital_responsibility, :min => 1
          %span.input-group-addon %

        = f.association :shared_capital_responsibility_organization, collection: Organization.all, label: 'Organization with Shared Capital Responsibility', required: true



        %h2.form-section-header
          Operations

        = f.input :max_permissible_speed, label: 'Maximum Permissible Speed', required: true

        = f.input :max_permissible_speed_unit, label: 'Unit', required: true

        = f.input :primary_fta_mode_type_id, collection: FtaModeType.active, label: 'Primary Mode', required: true
        
        = f.input :primary_fta_service_type_id, collection: FtaServiceType.active, label: 'Service Type (Primary Mode)', required: true

      .col-sm-6

        %h2.form-section-header
          Identification & Classification

        = f.input :asset_tag, label: 'Asset/Segment ID'

        = f.input :description, label: 'Description/Segment Name'

        .form-row-group

          .col-lg-5.row-col.left-col.clearfix.add-colon-parent

            = f.input :from_line, required: true, label: 'Line', wrapper_class: 'col-xs-4 row-col left-col'

            = f.input :from_segment, required: true, label: 'From', wrapper_class: 'col-xs-8 row-col right-col add-colon'

          .col-lg-5.row-col.middle-col.clearfix

            = f.input :to_line, required: true, label: 'Line', wrapper_class: 'col-xs-4 row-col left-col'

            = f.input :to_segment, required: true, label: 'To', wrapper_class: 'col-xs-8 row-col right-col'

          .col-lg-2.row-col.right-col.clearfix

            = f.input :segment_unit, required: true, label: 'Unit', wrapper_class: 'row-col'



  .form-actions.form-section
    = f.button :submit, '+ Add Asset & Go to New Record', :class => 'btn btn-primary'


  %hr
  = f.input :from_line
  = f.input :from_segment
  
  = f.input :to_segment
  = f.input :segment_unit
  = f.association :infrastructure_segment_unit_type, collection: InfrastructureSegmentUnitType.active
  = f.association :infrastructure_chain_type, collection: InfrastructureChainType.active
  = f.input :from_location_name
  = f.input :to_location_name
  = f.input :relative_location
  = f.input :relative_location_unit
  = f.input :relative_location_direction
  = f.input :asset_tag
  = f.input :external_id
  
  = f.input :location_name
  = f.input :fta_asset_category_id, as: :hidden, input_html: {value: @asset.fta_asset_class.fta_asset_category_id}
  = f.association :fta_asset_class
  = f.input :global_fta_type, :collection => FtaGuidewayType.all.map{|f| [ f.to_s, f.to_global_id ]}, required: true
  = f.association :asset_subtype
  = f.association :infrastructure_segment_type, collection: InfrastructureSegmentType.active.where(fta_asset_class: @asset.fta_asset_class) # need to add JS to hide based on subtype selected
  = f.association :infrastructure_division, collection: InfrastructureDivision.active.where(organization_id: @asset.organization_id)
  = f.association :infrastructure_subdivision, collection: InfrastructureSubdivision.active.where(organization_id: @asset.organization_id)
  = f.input :num_tracks

  %fieldset
    %legend Length
    = f.input :length
    = f.input :length_unit

  %fieldset
    %legend Minimum Vertical Clearance
    = f.input :height
    = f.input :height_unit

  %fieldset
    %legend Minimum Horizontal Clearance
    = f.input :width
    = f.input :width_unit

  = f.input :pcnt_capital_responsibility
  = f.association :shared_capital_responsibility_organization, collection: Organization.all

  = f.input :primary_fta_mode_type_id
  = f.input :primary_fta_service_type_id
  = f.input :nearest_city
  = f.input :nearest_state

  = f.association :land_ownership_organization
  = f.input :other_land_ownership_organization
  = f.association :title_ownership_organization, label: 'Infrastructure Owner'
  = f.input :other_title_ownership_organization, label: 'Infrastructure Owner (Other)'
  = f.association :infrastructure_bridge_type
  = f.input :num_spans
  = f.input :num_decks
  = f.association :infrastructure_crossing

  = f.simple_fields_for :condition_updates, @asset.condition_updates.build do |update_event|
    = update_event.input :assessed_rating

  = f.simple_fields_for :service_status_updates, @asset.service_status_updates.build do |update_event|
    = update_event.input :service_status_type_id, collection: ServiceStatusType.active
    = update_event.input :fta_emergency_contingency_fleet

  %ul.nav.nav-tabs
    - ComponentType.where(fta_asset_category: @asset.fta_asset_class.fta_asset_category, fta_asset_class: @asset.fta_asset_class).each do |component_type|
      %li
        %a{:href => "##{component_type}", :data =>{:toggle => 'tab'}}
          = component_type


  .tab-content
    - ComponentType.where(fta_asset_category: @asset.fta_asset_class.fta_asset_category, fta_asset_class: @asset.fta_asset_class).each do |component_type|
      .tab-pane.fade{id: component_type.to_s}
        .tab-content
          - component_element_types = ComponentElementType.where(component_type: component_type)
          - if component_element_types.count > 0
            - component_element_types.each do |component_element_type|
              %fieldset
                %legend= component_element_type
                - nested_id = "component_element_type_#{component_element_type.id}"
{'fraction_non_alphanumeric': 0.10951733514615908, 'fraction_numerical': 0.0023113528212100613, 'mean_word_length': 3.520897357098955, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 63, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2490855', 'n_tokens_mistral': 4792, 'n_tokens_neox': 4564, 'n_words': 867}