mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 20:59:30 +00:00
Added add test and add class buttons to tests and classes pages
This commit is contained in:
@@ -13,7 +13,8 @@ router.get('/classes', async (req, res) => {
|
||||
title: 'Stratos - Classes',
|
||||
current: 'Classes',
|
||||
name: req.session.fullName,
|
||||
classes: await u.getClasses()
|
||||
classes: await u.getClasses(),
|
||||
userType: req.session.userType
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -13,7 +13,8 @@ router.get('/tests', async (req, res) => {
|
||||
title: 'Stratos - Tests',
|
||||
current: 'Tests',
|
||||
name: req.session.fullName,
|
||||
tests: await u.getTests()
|
||||
tests: await u.getTests(),
|
||||
userType: req.session.userType
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -35,6 +35,13 @@
|
||||
.adminSection {
|
||||
margin: 1rem 0;
|
||||
|
||||
&--buttons {
|
||||
display: flex;
|
||||
gap: 1rem;
|
||||
justify-content: flex-end;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&:last-child {
|
||||
margin-bottom: 0;
|
||||
padding-bottom: 1rem;
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
}
|
||||
}
|
||||
|
||||
.btn--lg {
|
||||
padding: 1em 3em;
|
||||
}
|
||||
|
||||
@each $name, $colour in $button-colours {
|
||||
.btn.btn--#{$name}.btn--full {
|
||||
background: $colour;
|
||||
|
||||
@@ -1,14 +1,16 @@
|
||||
.classes {
|
||||
display: grid;
|
||||
column-gap: 1rem;
|
||||
row-gap: 1.5rem;
|
||||
margin-top: 1rem;
|
||||
&__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('medium') {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
}
|
||||
|
||||
@include respond-to('large') {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
@include respond-to('large') {
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,17 @@
|
||||
<section class='classes'>
|
||||
{{#each classes}}
|
||||
{{> class name=name teacher=teachers.[0] id=id }}
|
||||
{{/each}}
|
||||
<section class='adminSection adminSection--buttons'>
|
||||
{{#eq userType 'account'}}
|
||||
<div class='classes__buttons'>
|
||||
{{> button style='full' colour='primary' to='/admin/class/add' content='Add a new class' size='lg' }}
|
||||
</div>
|
||||
{{/eq}}
|
||||
</section>
|
||||
|
||||
<section class='adminSection classes'>
|
||||
<div class='classes__classes'>
|
||||
{{#each classes}}
|
||||
{{> class name=name teacher=teachers.[0] id=id }}
|
||||
{{/each}}
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<script>
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
<a class='btn btn--{{ style }} btn--{{ colour }}' href='{{ to }}'>
|
||||
<a class='btn btn--{{ style }} btn--{{ colour }} btn--{{ size }}' href='{{ to }}'>
|
||||
{{ content }}
|
||||
</a>
|
||||
|
||||
@@ -1,4 +1,12 @@
|
||||
<section class='tests adminSection'>
|
||||
<section class='adminSection adminSection--buttons'>
|
||||
{{#eq userType 'account'}}
|
||||
<div class='classes__buttons'>
|
||||
{{> button style='full' colour='primary' to='/admin/test/add' content='Add a new test' size='lg' }}
|
||||
</div>
|
||||
{{/eq}}
|
||||
</section>
|
||||
|
||||
<section class='adminSection tests'>
|
||||
<div class='adminItem'>
|
||||
<h2>Tests</h2>
|
||||
<div class='adminTable'>
|
||||
|
||||
Reference in New Issue
Block a user