1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 16:19:26 +00:00

Generalise testTables more

This commit is contained in:
2022-04-21 13:16:33 +00:00
parent 6d8e66eeb6
commit 586f84d65c
2 changed files with 29 additions and 27 deletions

View File

@@ -1,12 +1,32 @@
{{#if tests.length}} {{#if tests.length}}
<table> <table class='tests'>
{{#each tests}} {{#if full}}
{{> dashboardTest <thead>
id=id <tr>
name=template.name <th>Name</th>
date=date <th>Class</th>
}} <th>Subject</th>
{{/each}} <th>Date</th>
</tr>
</thead>
{{#each tests}}
{{> test
id=id
name=template.name
class=class.name
subject=class.subject.name
date=date
}}
{{/each}}
{{else}}
{{#each tests}}
{{> dashboardTest
id=id
name=template.name
date=date
}}
{{/each}}
{{/if}}
</table> </table>
{{else}} {{else}}
No tests found No tests found

View File

@@ -10,25 +10,7 @@
<div class='adminItem'> <div class='adminItem'>
<h2>Tests</h2> <h2>Tests</h2>
<div class='adminTable'> <div class='adminTable'>
<table> {{> testTable tests=tests full=true }}
<thead>
<tr>
<th>Name</th>
<th>Class</th>
<th>Subject</th>
<th>Date</th>
</tr>
</thead>
{{#each tests}}
{{> test
id=id
name=template.name
class=class.name
subject=class.subject.name
date=date
}}
{{/each}}
</table>
</div> </div>
</div> </div>
</section> </section>