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; $nav-height: 65px;
$textarea-min-height: 100px;
body{ body{
margin: 0; margin: 0;
padding: $nav-height 0 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{ #main-nav{
position: fixed; position: fixed;
top: 0; top: 0;

View File

@ -45,7 +45,8 @@ class TestController extends Controller {
$params = (array)$request->getParsedBody(); $params = (array)$request->getParsedBody();
$test = new Test; $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->benchmark_id = $params['test_benchmark'];
$test->component_id = $params['test_component']; $test->component_id = $params['test_component'];

View File

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

View File

@ -9,7 +9,7 @@
<table class="u-full-width"> <table class="u-full-width">
<thead> <thead>
<tr> <tr>
<th>Test Date</th> <th>Test title</th>
<th>Benchmark</th> <th>Benchmark</th>
<th>Hardware</th> <th>Hardware</th>
<th># of Results</th> <th># of Results</th>
@ -19,7 +19,7 @@
<tbody> <tbody>
{% for t in tests %} {% for t in tests %}
<tr> <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.benchmark.name }}</td>
<td>{{ t.component.name }}</td> <td>{{ t.component.name }}</td>
<td>{{ t.results | length }}</td> <td>{{ t.results | length }}</td>

View File

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