completed scaffolding for navigation sorting

This commit is contained in:
Ro 2019-01-10 16:54:07 -05:00
parent fb345a0b51
commit 46d04ceb1e
10 changed files with 83 additions and 5 deletions

View file

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

View file

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

View file

@ -1618,7 +1618,7 @@ svg.icons {
.main-container section header #header-wrapper #header-one label#the-title, .main-container section header #header-wrapper #header-one label#the-title,
.main-container section header #header-wrapper #header-two label#the-title { .main-container section header #header-wrapper #header-two label#the-title {
font-family: 'Apercu-Mono'; font-family: 'Apercu-Mono';
font-size: 2em; font-size: 1.5em;
color: #f5ab35; color: #f5ab35;
text-decoration: none; text-decoration: none;
display: block; 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 -- Forms
------------------------------- -------------------------------
**/ **/

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,6 @@
extends frame
block main-content
#nav-index
#nav-index-wrapper
| NAVI BRO

View file

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

View file

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

View file

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

View file

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

View file

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