Added views and routes for benchmarks

This commit is contained in:
2023-11-27 00:42:42 -05:00
parent 2f016d3062
commit 34faecc52c
6 changed files with 138 additions and 1 deletions

40
views/benchmark/add.twig Normal file
View File

@ -0,0 +1,40 @@
{% extends 'layouts/default.twig' %}
{% block title %}Add a Benchmark{% endblock %}
{% block content %}
<div class="row">
<h2>Add a benchmark</h2>
<form class="twelve columns" action="/benchmark/add" method="POST">
<div class="row">
<div class="nine columns">
<label for="benchmark_name">
Benchmark name:
<input id="benchmark_name" class="u-full-width" type="text" name="benchmark_name" placeholder="My hardware benchmarking benchmark">
</label>
</div>
<div class="three columns">
<label for="benchmark_scoring">
Scoring type:
<select id="benchmark_scoring" class="u-full-width" name="benchmark_scoring">
<option value="fps">Frames per second</option>
<option value="pts">Total points</option>
<option value="time">Frame time</option>
</select>
</label>
</div>
</div>
<div class="row">
<label for="benchmark_description">
Benchmark description:
<textarea id="benchmark_description" class="twelve columns" cols="30" rows="10" name="benchmark_description"></textarea>
</label>
</div>
<input class="button-primary u-full-width" type="submit" value="Submit">
</form>
</div>
{% endblock %}

31
views/benchmark/list.twig Normal file
View File

@ -0,0 +1,31 @@
{% extends 'layouts/default.twig' %}
{% block title %}List of Benchmarks{% endblock %}
{% block content %}
<div class="row">
<h2>Benchmarks</h2>
<a href="/benchmark/add">Add a benchmark</a>
<table class="twelve columns">
<thead>
<tr>
<td>Benchmark name</td>
<td>Scoring type</td>
<td>Created at</td>
<td>Last updated</td>
</tr>
</thead>
<tbody>
{% for b in benchmarks %}
<tr>
<td><a href="/benchmark/{{ b.id }}">{{ b.name }}</a></td>
<td>{{ b.scoring }}</td>
<td>{{ b.createdAt | date('m/d/Y g:ia') }}</td>
<td>{{ b.updatedAt | date('m/d/Y g:ia') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

17
views/benchmark/view.twig Normal file
View File

@ -0,0 +1,17 @@
{% extends 'layouts/default.twig' %}
{% block title %}{{ benchmark.name }}{% endblock %}
{% block content %}
<div class="row">
<h2>{{ benchmark.name }}</h2>
<p>Scoring type: {{ benchmark.scoring }}</p>
<p>{{ benchmark.description }}</p>
<hr>
<p><a href="/benchmark">Back</a></p>
</div>
{% endblock %}

View File

@ -15,7 +15,7 @@
<tbody>
{% for p in projects %}
<tr>
<td>{{ p.title }}</td>
<td><a href="/project/{{ p.id }}">{{ p.title }}</a></td>
<td>{{ p.updatedAt | date('m/d/Y g:ia') }}</td>
</tr>
{% endfor %}