game-data/views/hardware/view.erb

86 lines
2.3 KiB
Plaintext
Raw Permalink Normal View History

<div class="grid-x grid-margin-x">
<div class="cell small-12">
<h1><%= hardware.name %></h1>
</div>
<div class="cell small-12">
Hardware type: <%= hardware.type %>
</div>
</div>
<hr>
<div class="grix-x grix-margin-x">
<div class="cell small-12">
<form class="u-full-width" action="/result/add" method="post">
<input type="hidden" name="result_hardware" value="<%= hardware.id %>">
<input type="hidden" name="result_referrer" value="hardware">
<div class="grid-x grid-margin-x">
<div class="cell medium-5">
<label for="result_benchmark">
Add benchmark result:
<select class="u-full-width" id="result_benchmark" name="result_benchmark">
<% benchmarks.each do |b| %>
<option value="<%= b.id %>"><%= b.name %></option>
<% end %>
</select>
</label>
</div>
<div class="cell medium-2">
<label for="result_average">
Average score:
<input type="text" id="result_average" name="result_average" value="">
</label>
</div>
<div class="cell medium-2">
<label for="result_minimum">
Minimum score:
<input type="text" id="result_minimum" name="result_minimum" value="">
</label>
</div>
<div class="cell medium-2">
<label for="result_maximum">
Maximum score:
<input type="text" id="result_maximum" name="result_maximum" value="">
</label>
</div>
<div class="cell medium-1">
<input type="submit" class="u-full-width button" value="Submit">
</div>
</div>
</form>
<hr>
2024-02-09 08:42:49 -05:00
<h4>Benchmark results involving this hardware:</h4>
<table>
<thead>
<th>Benchmark name</th>
<th>Scoring type</th>
<th># results</th>
<th>Average</th>
<th>Minimum</th>
<th>Maximum</th>
</thead>
<tbody>
<% hardware.bench_results().each do |k, r| %>
<tr>
<td><%= k %></td>
<td>N/a</td>
<td><%= r.length %></td>
<td><%= average_array(r) %></td>
<td>N/a</td>
<td>N/a</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>