mirror of
https://github.com/matt-fidd/stratos.git
synced 2026-01-01 20:59:30 +00:00
Added admin layout and route to switch layouts
This commit is contained in:
5
app.js
5
app.js
@@ -80,6 +80,11 @@ async function main() {
|
||||
}
|
||||
}));
|
||||
|
||||
app.get('/admin/*', (req, res, next) => {
|
||||
req.app.locals.layout = 'admin';
|
||||
next();
|
||||
});
|
||||
|
||||
for (const [ root, router ] of loadRoutes().entries())
|
||||
app.use(root, router);
|
||||
|
||||
|
||||
12
views/layouts/admin.hbs
Normal file
12
views/layouts/admin.hbs
Normal file
@@ -0,0 +1,12 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang='en'>
|
||||
{{> head title=title }}
|
||||
<body>
|
||||
{{> adminHeader }}
|
||||
{{> adminNav active='dashboard'}}
|
||||
<main class='adminContent'>
|
||||
{{{ body }}}
|
||||
</main>
|
||||
{{> scripts }}
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user