2 Commits

Author SHA1 Message Date
533c407183 Updated some styles for tables and links 2024-05-29 15:07:54 -04:00
fb76f28643 Added tests to hardware page 2024-05-29 12:33:45 -04:00
7 changed files with 73 additions and 9 deletions

View File

@ -15,6 +15,22 @@ body{
background: #eee;
}
a{
color: teal;
transition: color 180ms ease-in-out;
}
a:hover{
color: darkcyan;
}
button.button-primary{
background: teal;
transition: background 180ms ease-in-out;
}
button.button-primary:hover{
background: darkcyan;
}
textarea{
max-width: 100%;
min-width: 100%;
@ -25,6 +41,33 @@ form select[multiple]{
min-height: 100px;
}
table{
border: 1px solid #ddd;
border-radius: 8px;
border-spacing: 0;
overflow: hidden;
}
table th,
table td,
table th:first-child,
table td:first-child{
border: none;
padding: 7px 12px;
}
table thead tr{
border-radius: 8px 8px 0 0;
}
table tbody tr:last-child{
border-radius: 0 0 8px 8px;
}
table thead tr,
table tr:nth-child(even){
background: #eee;
}
/* Material card styles */
.card-1 {
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24);
@ -52,7 +95,7 @@ form select[multiple]{
}
.container{
max-width: 1024px;
max-width: 1200px;
}
#main-nav{
@ -92,7 +135,7 @@ form select[multiple]{
}
#main-content{
padding: 14px 20px;
padding: 15px 25px;
background: white;
border-radius: 8px;
z-index: 10;

View File

@ -4,7 +4,7 @@
<h2>Benchmark</h2>
<a href="/benchmark/create">Add new benchmark</a>
<table class="twelve columns">
<table class="twelve columns card-1">
<thead>
<tr>
<td>Name</td>

View File

@ -4,7 +4,7 @@
<h2>Hardware</h2>
<a href="/hardware/create">Add new hardware</a>
<table class="twelve columns">
<table class="twelve columns card-1">
<thead>
<tr>
<td>Name</td>

View File

@ -7,9 +7,30 @@
<hr>
<h4>Latest Benchmark Results:</h4>
<h4>Tests Using This Component:</h4>
<p>There are currently no benchmarks recorded using this hardware component.</p>
{{ $length := len .hardware.Tests }} {{ if eq $length 0 }}
<p>There are currently no tests using this hardware component.</p>
{{ else }}
<table class="u-full-width card-1">
<thead>
<tr>
<th>Test</th>
<th># of Benchmarks</th>
<th>Last Updated</th>
</tr>
</thead>
<tbody>
{{ range $test := .hardware.Tests }}
<tr>
<td><a href="/test/{{ $test.ID }}">{{ $test.Name }}</a></td>
<td>{{ len $test.Benchmarks }}</td>
<td>{{ $test.CreatedAt.Format "01/02/2006 15:04am" }}</td>
</tr>
{{ end }}
</tbody>
</table>
{{ end }}
<hr>

View File

@ -4,7 +4,7 @@
<h2>Tests</h2>
<a href="/test/create">Create a new test</a>
<table class="twelve columns">
<table class="twelve columns card-1">
<thead>
<tr>
<td>Title</td>

View File

@ -69,7 +69,7 @@
{{ $length := len .test.Results }} {{ if eq $length 0 }}
<p>There are currently no benchmarks recorded in this test.</p>
{{ else }}
<table class="u-full-width">
<table class="u-full-width card-1">
<thead>
<tr>
<th>Benchmark</th>

View File

@ -30,7 +30,7 @@ func HardwareGetView(c flamego.Context, t template.Template, data template.Data)
// find hardware from DB
var hardware models.Hardware
models.DB.First(&hardware, hardwareID)
models.DB.Preload("Tests.Benchmarks").First(&hardware, hardwareID)
data["hardware"] = hardware
data["title"] = hardware.Name