Updated test views and routes for the new test attributes

This commit is contained in:
Gregory Ballantine 2024-04-06 12:08:23 -04:00
parent 0c1df2e7e6
commit 33c9bf5cb5
5 changed files with 27 additions and 9 deletions

View File

@ -3,6 +3,8 @@ $primary-color-highlight: lighten($primary-color, 10%);
$nav-height: 65px;
$textarea-min-height: 100px;
body{
margin: 0;
padding: $nav-height 0 0;
@ -17,6 +19,12 @@ a{
}
}
textarea{
min-width: 100%;
max-width: 100%;
min-height: $textarea-min-height;
}
#main-nav{
position: fixed;
top: 0;

View File

@ -45,7 +45,8 @@ class TestController extends Controller {
$params = (array)$request->getParsedBody();
$test = new Test;
$test->date_tag = $params['test_date_tag'];
$test->title = $params['test_title'];
$test->description = $params['test_description'];
$test->benchmark_id = $params['test_benchmark'];
$test->component_id = $params['test_component'];

View File

@ -14,14 +14,14 @@
<div class="twelve columns">
<form action="{{ url_for('test.add') }}" method="POST" class="u-full-width">
<div class="row">
<div class="two columns">
<div class="four columns">
<label>
Date Tag:
<input class="u-full-width" type="text" name="test_date_tag" placeholder="(XY/AB)">
Test title:
<input class="u-full-width" type="text" name="test_title" placeholder="My new test">
</label>
</div>
<div class="five columns">
<div class="four columns">
<label>
Benchmark:
<select class="u-full-width" name="test_benchmark">
@ -32,7 +32,7 @@
</label>
</div>
<div class="five columns">
<div class="four columns">
<label>
Hardware component:
<select class="u-full-width" name="test_component">
@ -44,6 +44,15 @@
</div>
</div>
<div class="row">
<div class="twelve columns">
<label>
Test description:
<textarea class="u-full-width" name="test_description" rows="8"></textarea>
</label>
</div>
</div>
<input class="button button-primary u-full-width" type="submit" value="Submit">
</form>
</div>

View File

@ -9,7 +9,7 @@
<table class="u-full-width">
<thead>
<tr>
<th>Test Date</th>
<th>Test title</th>
<th>Benchmark</th>
<th>Hardware</th>
<th># of Results</th>
@ -19,7 +19,7 @@
<tbody>
{% for t in tests %}
<tr>
<td><a href="{{ url_for('test.view', { test_id: t.id }) }}">{{ t.date_tag }}</a></td>
<td><a href="{{ url_for('test.view', { test_id: t.id }) }}">{{ t.title }}</a></td>
<td>{{ t.benchmark.name }}</td>
<td>{{ t.component.name }}</td>
<td>{{ t.results | length }}</td>

View File

@ -5,7 +5,7 @@
{% block content %}
<div class="row">
<div class="twelve columns">
<h1>{{ test.name }}</h1>
<h1>{{ test.title }}</h1>
<p>{{ test.description }}</p>
</div>
</div>