Fixed the test edit view
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed

This commit is contained in:
2025-07-26 11:37:43 -04:00
parent 49d1276031
commit 55e4f397f8
3 changed files with 47 additions and 24 deletions

View File

@ -1,30 +1,47 @@
<div class="row">
<div class="row mb-3">
<div class="col-12">
<h1>Editing: <%= hardware.name %></h1>
<h1>Editing: <%= test.name %></h1>
</div>
</div>
<div class="row">
<form class="col-12" action="/hardware/<%= hardware.id %>/edit" method="post">
<div class="row mb-3">
<div class="col-12 col-md-9">
<label for="hardware_name">Hardware name</label>
<input id="hardware_name" class="form-control" type="text" name="hardware_name" placeholder="Example hardware" value="<%= hardware.name %>">
<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-3">
<label for="hardware_type">Type</label>
<select id="hardware_type" class="form-control" name="hardware_type">
<option value="gpu" <% if hardware.type == 'gpu' %>selected<% end %>>Graphics card</option>
<option value="cpu" <% if hardware.type == 'cpu' %>selected<% end %>>Processor</option>
<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 %>"><%= 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">
<input class="btn btn-primary w-100" type="submit" value="Create Test">
</div>
</div>
</form>