mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-02 08:19:31 +00:00
Add route for reports page, with test data
This commit is contained in:
@@ -3,21 +3,56 @@
|
|||||||
const express = require('express');
|
const express = require('express');
|
||||||
const router = express.Router();
|
const router = express.Router();
|
||||||
|
|
||||||
router.get('/reports', (req, res, next) => {
|
router.get('/reports', (req, res) => {
|
||||||
/* eslint-disable multiline-comment-style */
|
|
||||||
/*
|
|
||||||
return res.render('reports', {
|
return res.render('reports', {
|
||||||
...req.hbsContext,
|
...req.hbsContext,
|
||||||
title: 'Stratos - Reports',
|
title: 'Stratos - Reports',
|
||||||
current: 'Reports'
|
current: 'Reports',
|
||||||
|
types: [
|
||||||
|
{
|
||||||
|
key: 'student',
|
||||||
|
value: 'Student'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'class',
|
||||||
|
value: 'Class'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
targets: JSON.stringify({
|
||||||
|
student: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: 'joe'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
class: [
|
||||||
|
{
|
||||||
|
id: '1',
|
||||||
|
name: 'joeseph'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '2',
|
||||||
|
name: 'bob'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '3',
|
||||||
|
name: 'fred'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
id: '4',
|
||||||
|
name: 'mike'
|
||||||
|
}
|
||||||
|
]
|
||||||
|
})
|
||||||
});
|
});
|
||||||
*/
|
});
|
||||||
/* eslint-enable multiline-comment-style */
|
|
||||||
|
|
||||||
next();
|
router.post('/report/generate', (req, res) => {
|
||||||
|
return res.redirect('/admin/reports');
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
root: '/admin',
|
root: '/admin',
|
||||||
router: router
|
router: router
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user