mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-02 01:19:31 +00:00
Added tests page
This commit is contained in:
@@ -17,6 +17,12 @@ router.get('/classes', (req, res) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.get('/tests', (req, res) => {
|
||||||
|
return res.render('tests', {
|
||||||
|
title: 'Stratos - Tests'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: '/admin',
|
root: '/admin',
|
||||||
router: router
|
router: router
|
||||||
|
|||||||
6
views/partials/test.hbs
Normal file
6
views/partials/test.hbs
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
<tr data-id='{{ id }}'>
|
||||||
|
<td>{{ name }}</td>
|
||||||
|
<td>{{ class }}</td>
|
||||||
|
<td>{{ subject }}</td>
|
||||||
|
<td>{{ date }}</td>
|
||||||
|
</tr>
|
||||||
69
views/tests.hbs
Normal file
69
views/tests.hbs
Normal file
@@ -0,0 +1,69 @@
|
|||||||
|
<section class='tests adminSection'>
|
||||||
|
<div class='adminItem'>
|
||||||
|
<h2>Tests</h2>
|
||||||
|
<div class='adminTable'>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Name</th>
|
||||||
|
<th>Subject</th>
|
||||||
|
<th>Class</th>
|
||||||
|
<th>Date</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
{{> test
|
||||||
|
id='1'
|
||||||
|
name='Organic Synthesis'
|
||||||
|
subject='Chemistry'
|
||||||
|
class='MKA_133'
|
||||||
|
date='01/08/2021'
|
||||||
|
}}
|
||||||
|
{{> test
|
||||||
|
id='2'
|
||||||
|
name='Organic Synthesis'
|
||||||
|
subject='Chemistry'
|
||||||
|
class='MKA_133'
|
||||||
|
date='01/08/2021'
|
||||||
|
}}
|
||||||
|
{{> test
|
||||||
|
id='3'
|
||||||
|
name='Organic Synthesis'
|
||||||
|
subject='Chemistry'
|
||||||
|
class='MKA_133'
|
||||||
|
date='01/08/2021'
|
||||||
|
}}
|
||||||
|
{{> test
|
||||||
|
id='4'
|
||||||
|
name='Organic Synthesis'
|
||||||
|
subject='Chemistry'
|
||||||
|
class='MKA_133'
|
||||||
|
date='01/08/2021'
|
||||||
|
}}
|
||||||
|
{{> test
|
||||||
|
id='5'
|
||||||
|
name='Organic Synthesis'
|
||||||
|
subject='Chemistry'
|
||||||
|
class='MKA_133'
|
||||||
|
date='01/08/2021'
|
||||||
|
}}
|
||||||
|
{{> test
|
||||||
|
id='6'
|
||||||
|
name='Organic Synthesis'
|
||||||
|
subject='Chemistry'
|
||||||
|
class='MKA_133'
|
||||||
|
date='01/08/2021'
|
||||||
|
}}
|
||||||
|
</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>
|
||||||
Reference in New Issue
Block a user