completed scaffolding for navigation sorting
parent
fb345a0b51
commit
46d04ceb1e
@ -0,0 +1,43 @@
|
||||
const express = require('express');
|
||||
const router = express.Router();
|
||||
const Models = require('../../models');
|
||||
const fs = require("fs-extra");
|
||||
//--------------------------
|
||||
// SETTINGS
|
||||
//--------------------------
|
||||
router.get('/', function(req, res)
|
||||
{
|
||||
if (req.session.user)
|
||||
{
|
||||
Models.User.findById(req.session.user.id).then((user) =>
|
||||
{
|
||||
let pages = [];
|
||||
Models.FreshPost.findAll(
|
||||
{
|
||||
order: [
|
||||
['id', 'DESC']
|
||||
]
|
||||
}).then(posts =>
|
||||
{
|
||||
for (let index = 0; index < posts.length; index++)
|
||||
{
|
||||
let item = posts[index].post;
|
||||
if(item.page == true || item.page == "true") pages.push(posts[index]);
|
||||
}
|
||||
}).catch(err =>
|
||||
{
|
||||
console.log("ERROR", err)
|
||||
})
|
||||
res.render('dash/navigation',
|
||||
{
|
||||
pages: pages,
|
||||
title: 'Dashboard | Global Nav'
|
||||
});
|
||||
})
|
||||
}
|
||||
else
|
||||
{
|
||||
res.redirect('/@/dashboard');
|
||||
}
|
||||
});
|
||||
module.exports = router;
|
File diff suppressed because one or more lines are too long
@ -0,0 +1,6 @@
|
||||
extends frame
|
||||
block main-content
|
||||
#nav-index
|
||||
#nav-index-wrapper
|
||||
| NAVI BRO
|
||||
|
@ -0,0 +1,7 @@
|
||||
#nav-index
|
||||
width 100%
|
||||
max-width 900px
|
||||
margin 0 auto
|
||||
|
||||
#nav-index-wrapper
|
||||
padding 0.75rem
|
Loading…
Reference in New Issue