= f.inputs name: 'Track fields' do

  ol.nested-fields
    = f.input :track_type, :as => :select, collection: ['Track', 'Master'], include_blank: false
    = f.input :instrument, collection: Instrument.all, include_blank: false
    = f.input :part, :required=>true, :input_html => { :rows=>1, :maxlength=>20, :type=>'numeric' }
    = f.input :position
    - if !f.object.nil? && f.object.track_type != 'Master'
      = f.input :preview_start_time_raw, :label => 'Preview Start Time', :hint => 'MM:SS:MLS', :as => :string
    - unless f.object.nil? || f.object[:preview_url].nil?
      .current_file_holder style='margin-bottom:10px'
        a href=f.object.preview_public_url('ogg') style='padding:0 0 0 20px'
          | Download Preview (ogg)
        a href=f.object.preview_public_url('mp3') style='padding:0 0 0 20px'
          | Download Preview (mp3)

    // temporarily disable
    - if f.object.new_record?
      //p style='margin-left:10px'
        //i
        //  | before you can upload, you must select 'Update JamTrack'
    - else
      // = f.input :url_48, :as => :file, :label => 'Track file (48kHz)'
      - unless f.object.nil? || f.object[:url_48].nil?
        .current_file_holder style='margin-bottom:10px'
          a href=f.object.sign_url(3600) style='padding:0 0 0 20px'
            | #{File.basename(f.object[:url_48])}

      // = f.input :url_44, :as => :file, :label => 'Track file (44kHz)'
      - unless f.object.nil? || f.object[:url_44].nil?
        .current_file_holder style='margin-bottom:10px'
          a href=f.object.sign_url(3600, 44) style='padding:0 0 0 20px'
            | #{File.basename(f.object[:url_44])}

    = link_to_remove_association "Delete Track", f, class: 'button', style: 'margin-left:10px'