Removed projects; added tests

This commit is contained in:
2023-12-02 23:41:04 -05:00
parent 286219c5ea
commit 75552eccee
16 changed files with 209 additions and 146 deletions

View File

@ -4,7 +4,7 @@
{% block content %}
<div class="row">
<h2>Recently updated projects:</h2>
<h2>Recently updated tests:</h2>
<table class="twelve columns">
<thead>
<tr>
@ -13,9 +13,9 @@
</tr>
</thead>
<tbody>
{% for p in projects %}
{% for p in tests %}
<tr>
<td><a href="/project/{{ p.id }}">{{ p.title }}</a></td>
<td><a href="/test/{{ p.id }}">{{ p.date_tag }}</a></td>
<td>{{ p.updatedAt | date('m/d/Y g:ia') }}</td>
</tr>
{% endfor %}

View File

@ -3,9 +3,9 @@
<h4>Leviathan</h4>
<ul>
<li><a href="/">Dashboard</a></li>
<li><a href="/project">Projects</a></li>
<li><a href="/test">Tests</a></li>
<li><a href="/hardware">Hardware</a></li>
<li><a href="/benchmark">Benchmarks</a></li>
</ul>
</div>
</nav>
</nav>

View File

@ -1,27 +0,0 @@
{% extends 'layouts/default.twig' %}
{% block title %}Add a Project{% endblock %}
{% block content %}
<div class="row">
<h2>Add a project</h2>
<form class="twelve columns" action="/project/add" method="POST">
<div class="row">
<label for="project_title">
Project title:
<input id="project_title" class="u-full-width" type="text" name="project_title" placeholder="My hardware benchmarking project">
</label>
</div>
<div class="row">
<label for="project_description">
Project description:
<textarea id="project_description" class="twelve columns" cols="30" rows="10" name="project_description"></textarea>
</label>
</div>
<input class="button-primary u-full-width" type="submit" value="Submit">
</form>
</div>
{% endblock %}

View File

@ -1,29 +0,0 @@
{% extends 'layouts/default.twig' %}
{% block title %}List of Projects{% endblock %}
{% block content %}
<div class="row">
<h2>Projects</h2>
<a href="/project/add">Add a project</a>
<table class="twelve columns">
<thead>
<tr>
<td>Title</td>
<td>Created at</td>
<td>Last updated</td>
</tr>
</thead>
<tbody>
{% for p in projects %}
<tr>
<td><a href="/project/{{ p.id }}">{{ p.title }}</a></td>
<td>{{ p.createdAt | date('m/d/Y g:ia') }}</td>
<td>{{ p.updatedAt | date('m/d/Y g:ia') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

View File

@ -1,15 +0,0 @@
{% extends 'layouts/default.twig' %}
{% block title %}{{ project.title }}{% endblock %}
{% block content %}
<div class="row">
<h2>{{ project.title }}</h2>
<p>{{ project.description }}</p>
<hr>
<p><a href="/project">Back</a></p>
</div>
{% endblock %}

53
views/test/add.twig Normal file
View File

@ -0,0 +1,53 @@
{% extends 'layouts/default.twig' %}
{% block title %}Add a Test{% endblock %}
{% block content %}
<div class="row">
<h2>Add a test</h2>
<form class="twelve columns" action="/test/add" method="POST">
<div class="row">
<div class="three columns">
<label for="test_date_tag">
Test date tag:
<input id="test_date_tag" class="u-full-width" type="text" name="test_date_tag" placeholder="(XX/YY)">
</label>
</div>
<div class="nine columns">
<label for="test_hardware">
Test hardware:
<select id="test_hardware" class="u-full-width" name="test_hardware">
{% for h in hardware %}
<option value="{{ h.id }}">{{ h.name }}</option>
{% endfor %}
</select>
</label>
</div>
</div>
<div class="row">
<div class="twelve columns">
<label for="test_benchmarks">
Test benchmarks:
<select id="test_benchmarks" class="u-full-width" name="test_benchmarks[]" multiple>
{% for b in benchmarks %}
<option value="{{ b.id }}">{{ b.name }}</option>
{% endfor %}
</select>
</label>
</div>
</div>
<div class="row">
<label for="test_description">
Test description:
<textarea id="test_description" class="twelve columns" cols="30" rows="10" name="test_description"></textarea>
</label>
</div>
<input class="button-primary u-full-width" type="submit" value="Submit">
</form>
</div>
{% endblock %}

29
views/test/list.twig Normal file
View File

@ -0,0 +1,29 @@
{% extends 'layouts/default.twig' %}
{% block title %}List of Tests{% endblock %}
{% block content %}
<div class="row">
<h2>Tests</h2>
<a href="/test/add">Add a test</a>
<table class="twelve columns">
<thead>
<tr>
<td>Date Tag</td>
<td>Created at</td>
<td>Last updated</td>
</tr>
</thead>
<tbody>
{% for t in tests %}
<tr>
<td><a href="/test/{{ t.id }}">{{ t.dateTag }} {{ t.getHardware().name }}</a></td>
<td>{{ t.createdAt | date('m/d/Y g:ia') }}</td>
<td>{{ t.updatedAt | date('m/d/Y g:ia') }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% endblock %}

21
views/test/view.twig Normal file
View File

@ -0,0 +1,21 @@
{% extends 'layouts/default.twig' %}
{% block title %}Test: {{ test.getHardware().name }} - {{ test.dateTag }}{% endblock %}
{% block content %}
<div class="row">
<h2>Test: {{ test.getHardware().name }} - {{ test.dateTag }}</h2>
<div class="twelve columns">
<ul>
{% for b in test.getBenchmarks() %}
<li>{{ b.name }}</li>
{% endfor %}
</ul>
</div>
<hr>
<p><a href="/test">Back</a></p>
</div>
{% endblock %}