mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-02 01:19:31 +00:00
Added classes page
This commit is contained in:
@@ -11,6 +11,11 @@ router.get('/dashboard', (req, res) => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
router.get('/classes', (req, res) => {
|
||||||
|
return res.render('classes', {
|
||||||
|
title: 'Stratos - Classes'
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: '/admin',
|
root: '/admin',
|
||||||
|
|||||||
12
src/stylesheets/components/_class.scss
Normal file
12
src/stylesheets/components/_class.scss
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
.classes__class {
|
||||||
|
transition: background .25s, color .25s;
|
||||||
|
position: relative;
|
||||||
|
min-height: 10rem;
|
||||||
|
border-top: 10px solid $primary-colour;
|
||||||
|
|
||||||
|
@include on-event() {
|
||||||
|
cursor: pointer;
|
||||||
|
background-color: $primary-colour;
|
||||||
|
color: white;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -18,6 +18,8 @@
|
|||||||
@import 'components/adminNav';
|
@import 'components/adminNav';
|
||||||
@import 'components/adminNavItem';
|
@import 'components/adminNavItem';
|
||||||
@import 'components/admin';
|
@import 'components/admin';
|
||||||
|
@import 'components/class';
|
||||||
|
|
||||||
@import 'pages/index';
|
@import 'pages/index';
|
||||||
@import 'pages/dashboard';
|
@import 'pages/dashboard';
|
||||||
|
@import 'pages/classes';
|
||||||
|
|||||||
14
src/stylesheets/pages/_classes.scss
Normal file
14
src/stylesheets/pages/_classes.scss
Normal file
@@ -0,0 +1,14 @@
|
|||||||
|
.classes {
|
||||||
|
display: grid;
|
||||||
|
column-gap: 1rem;
|
||||||
|
row-gap: 1.5rem;
|
||||||
|
margin-top: 1rem;
|
||||||
|
|
||||||
|
@include respond-to('medium') {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
}
|
||||||
|
|
||||||
|
@include respond-to('large') {
|
||||||
|
grid-template-columns: repeat(3, 1fr);
|
||||||
|
}
|
||||||
|
}
|
||||||
16
views/classes.hbs
Normal file
16
views/classes.hbs
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
<section class='classes'>
|
||||||
|
{{> class name='13(3) Chemistry' teacher='Dr M Ashley' id=1 }}
|
||||||
|
{{> class name='13(3) Chemistry' teacher='Dr M Ashley' id=2 }}
|
||||||
|
{{> class name='13(3) Chemistry' teacher='Dr M Ashley' id=3 }}
|
||||||
|
{{> class name='13(3) Chemistry' teacher='Dr M Ashley' id=4 }}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
const classes = document.querySelectorAll('.classes__class');
|
||||||
|
classes.forEach(c => {
|
||||||
|
c.addEventListener('click', () => {
|
||||||
|
window.location.href =
|
||||||
|
`/admin/class/${c.getAttribute('data-id')}`;
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
4
views/partials/class.hbs
Normal file
4
views/partials/class.hbs
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
<div class='classes__class adminItem' data-id={{ id }}>
|
||||||
|
<h2>{{ name }}</h2>
|
||||||
|
<h3>{{ teacher }}</h3>
|
||||||
|
</div>
|
||||||
Reference in New Issue
Block a user