1
0
mirror of https://github.com/matt-fidd/stratos.git synced 2026-01-01 22:59:28 +00:00

Turn a table of tests into a component

This commit is contained in:
2022-03-03 02:04:41 +00:00
parent 9c66a50973
commit f8982af977
2 changed files with 20 additions and 0 deletions

View File

@@ -2,3 +2,10 @@
<td>{{ date }}</td> <td>{{ date }}</td>
<td>{{ name }}</td> <td>{{ name }}</td>
</tr> </tr>
<script>
document.querySelector('.adminTable tr[data-id="{{id}}"]').addEventListener('click', (e) => {
const test = e.path[1];
window.location.href = `/admin/test/${test.getAttribute('data-id')}`;
});
</script>

View File

@@ -0,0 +1,13 @@
{{#if tests.length}}
<table>
{{#each tests}}
{{> dashboardTest
id=id
name=template.name
date=date
}}
{{/each}}
</table>
{{else}}
No tests found
{{/if}}