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

Make dashboard use new testTable component

This commit is contained in:
2022-03-03 02:05:00 +00:00
parent f8982af977
commit b3942491d2

View File

@@ -11,15 +11,7 @@
<div class='adminItem'>
<h2>Recent Tests</h2>
<div class='adminTable'>
<table>
{{#each recentTests}}
{{> dashboardTest
id=id
name=template.name
date=date
}}
{{/each}}
</table>
{{> testTable tests=recentTests}}
</div>
</div>
</div>
@@ -27,26 +19,8 @@
<div class='adminItem'>
<h2>Upcoming Tests</h2>
<div class='adminTable'>
<table>
{{#each upcomingTests}}
{{> dashboardTest
id=id
name=template.name
date=date
}}
{{/each}}
</table>
{{> testTable tests=upcomingTests}}
</div>
</div>
</div>
</section>
<script>
const tests = document.querySelectorAll('.adminTable tr');
tests.forEach(test => {
test.addEventListener('click', () => {
window.location.href =
`/admin/test/${test.getAttribute('data-id')}`;
});
});
</script>