<%= semantic_form_for([:admin, @test_drive_package],  html: {:multipart => true}, url: @test_drive_package.new_record? ? admin_test_drive_packages_path : "#{ENV['RAILS_RELATIVE_URL_ROOT']}/admin/test_drive_packages/#{@test_drive_package.id}") do |f| %>
  <%= f.semantic_errors *f.object.errors.keys %>
  <%= f.inputs do %>
    <%= f.input :name, required: true, label: "Package ID", hint: "The name to use as the utm-teachers parameter in the student landing URL" %>
    <%= f.input :package_type, required: true, label: "Package Type", as: :select, collection: ['1', '2', '4'], hint: "TestDrive package type"  %>
    <%= f.input :description, label: "Package Description", hint: "Admin-only friendly description of the package"  %>

    <%= f.semantic_fields_for :test_drive_package_teachers do |teacher| %>
      <%= render 'test_drive_package_teacher_fields', f: teacher %>
    <% end %>

    <% if !@test_drive_package.new_record? %>
    <div class="links">
      <%= link_to_add_association 'Add Teacher', f, :test_drive_package_teachers, class: 'button', style: 'margin:20px;padding:10px 20px' %>
    </div>
    <% end %>

    <%= f.actions %>
  <% end %>
<% end %>