completed scaffolding for navigation sorting

sql-version-freeze
Ro 6 years ago
parent fb345a0b51
commit 46d04ceb1e

@ -45,6 +45,7 @@ var front = require('./routes/front/index')(session);
var back = require('./routes/back/index');
var postDashboard = require('./routes/back/dash_posts');
var settingsDashboard = require('./routes/back/dash_settings');
var navDashboard = require('./routes/back/dash_nav');
//api
var postLibrary = require('./api/content/posts');
var settings = require('./api/content/settings');
@ -58,6 +59,7 @@ app.use('/', front);
app.use('/@/dashboard', back);
app.use('/@/dashboard/posts', postDashboard);
app.use('/@/dashboard/settings', settingsDashboard);
app.use('/@/dashboard/navigation', navDashboard);
//app.use('/mailer', mailer);
// catch 404 and forward to error handler
app.use(function(req, res, next)

@ -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;

@ -1618,7 +1618,7 @@ svg.icons {
.main-container section header #header-wrapper #header-one label#the-title,
.main-container section header #header-wrapper #header-two label#the-title {
font-family: 'Apercu-Mono';
font-size: 2em;
font-size: 1.5em;
color: #f5ab35;
text-decoration: none;
display: block;
@ -2040,6 +2040,19 @@ svg.icons {
}
/**
-------------------------------
-- Navigation
-------------------------------
**/
#nav-index {
width: 100%;
max-width: 900px;
margin: 0 auto;
}
#nav-index #nav-index-wrapper {
padding: 0.75rem;
}
/**
-------------------------------
-- Forms
-------------------------------
**/

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

@ -7,7 +7,7 @@
svg(viewBox="0 0 20 20" class="icons")
use(xlink:href='/dash/assets/images/sprite.svg#entypo-cog')
label Settings
a#menu(href="")
a#navigation(href="/@/dashboard/navigation")
svg(viewBox="0 0 20 20" class="icons")
use(xlink:href='/dash/assets/images/sprite.svg#entypo-list')
label Navigation

@ -55,7 +55,6 @@ block main-content
a.mail-option#option-smtp(href="#", data-enabled='true') SMTP
-else
a.mail-option#option-smtp(href="#", data-enabled='false') SMTP
include partials/mailforms
br

@ -63,6 +63,14 @@
@import "main/_settings"
/**
-------------------------------
-- Navigation
-------------------------------
**/
@import "main/_navigation"
/**
-------------------------------
-- Forms

@ -0,0 +1,7 @@
#nav-index
width 100%
max-width 900px
margin 0 auto
#nav-index-wrapper
padding 0.75rem

@ -57,7 +57,7 @@ svg.icons
label#the-title
font-family 'Apercu-Mono'
font-size 2em
font-size 1.5em
color $tertiary
text-decoration none
display block

Loading…
Cancel
Save