1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 20:39:28 +00:00
Files
stratos/views/tests.hbs
2022-02-25 19:52:45 +00:00

37 lines
678 B
Handlebars

<section class='tests adminSection'>
<div class='adminItem'>
<h2>Tests</h2>
<div class='adminTable'>
<table>
<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>
</section>
<script>
const tests = document.querySelectorAll('.tests tbody tr');
tests.forEach(t => {
t.addEventListener('click', () => {
window.location.href =
`/admin/test/${t.getAttribute('data-id')}`;
});
});
</script>