1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 18:19:25 +00:00
Files
stratos/views/testTemplates.hbs
2022-04-25 15:17:44 +00:00

39 lines
991 B
Handlebars

<section class='adminSection adminSection--buttons'>
{{#eq userType 'account'}}
<div class='classes__buttons'>
{{> button style='full' colour='primary' to='/admin/test-template/add' content='Add a new test template' size='lg' }}
</div>
{{/eq}}
</section>
<section class='adminSection tests'>
<div class='adminItem'>
<h2>Test Templates</h2>
<div class='adminTable'>
<table>
<thead>
<tr>
<th>Name</th>
<th>Maximum Mark</th>
</tr>
</thead>
{{#each templates}}
<tr data-id='{{ id }}'>
<td>{{ name }}</td>
<td>{{ maxMark }}</td>
</tr>
<script>
document.querySelector('.tests tbody tr[data-id="{{id}}"]').addEventListener(touchEvent, (e) => {
const path = e.path || (e.composedPath && e.composedPath());
const template = path[1];
window.location.href = `/admin/test-template/${template.getAttribute('data-id')}`;
});
</script>
{{/each}}
</table>
</div>
</div>
</section>