<div class="row mb-3">
  <div class="col-12">
    <h1>Editing: <%= test.name %></h1>
  </div>
</div>

<div class="row">

  <form class="col-12" action="/test/<%= test.id %>/edit" method="post">
    <div class="row mb-0 mb-md-3">
      <div class="col-12 col-md-6 mb-3 mb-md-0">
        <label for="test_name">Test name</label>
        <input id="test_name" class="form-control" type="text" name="test_name" placeholder="My hardware test (01/99)" value="<%= test.name %>">
      </div>

      <div class="col-12 col-md-6 mb-3 mb-md-0">
        <label for="test_hardware">Hardware to test</label>
        <select id="test_hardware" class="form-select" name="test_hardware">
          <% for h in hardware %>
            <option value="<%= h.id %>" <% if h.id == test.hardware.id %>selected<% end %>><%= h.name %></option>
          <% end %>
        </select>
      </div>
    </div>

    <div class="row mb-0 mb-md-3">
      <div class="col-12 col-md-4 mb-3 mb-md-0">
        <label for="test_benchmarks">Benchmarks</label>
        <select id="test_benchmarks" class="form-select" name="test_benchmarks[]" multiple>
          <% for b in benchmarks %>
            <option value="<%= b.id %>" <% if test.benchmark?(b.id) %>selected<% end %>><%= b.name %></option>
            <% end %>
        </select>
      </div>

      <div class="col-12 col-md-8 mb-3 mb-md-0">
        <label for="test_description">Test description</label>
        <textarea id="test_description" class="form-control" name="test_description" placeholder="This is my test for a hardware..."><%= test.description %></textarea>
      </div>
    </div>

    <div class="row">
      <div class="col-12">
        <input class="btn btn-primary w-100" type="submit" value="Submit Changes">
      </div>
    </div>
  </form>

</div>
