mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 20:59:30 +00:00
Turn a table of tests into a component
This commit is contained in:
@@ -2,3 +2,10 @@
|
||||
<td>{{ date }}</td>
|
||||
<td>{{ name }}</td>
|
||||
</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>
|
||||
|
||||
13
views/partials/testTable.hbs
Normal file
13
views/partials/testTable.hbs
Normal 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}}
|
||||
Reference in New Issue
Block a user