| @ -1,111 +0,0 @@ | |||||
| <!-- Introduction menu --> | |||||
| <div class="w3-col l4"> | |||||
| <!-- About Card --> | |||||
| <div class="w3-card w3-margin w3-margin-top"> | |||||
| <div class="w3-container w3-white"> | |||||
| <h4><b>My Name</b></h4> | |||||
| <p>Just me, myself and I, exploring the universe of uknownment. I have a heart of love and a interest of lorem ipsum and mauris neque quam blog. I want to share my world with you.</p> | |||||
| </div> | |||||
| </div><hr> | |||||
| <!-- Posts --> | |||||
| <div class="w3-card w3-margin"> | |||||
| <div class="w3-container w3-padding"> | |||||
| <h4>Popular Posts</h4> | |||||
| </div> | |||||
| <ul class="w3-ul w3-hoverable w3-white"> | |||||
| <li class="w3-padding-16"> | |||||
| <span class="w3-large">Lorem</span><br> | |||||
| <span>Sed mattis nunc</span> | |||||
| </li> | |||||
| <li class="w3-padding-16"> | |||||
| <span class="w3-large">Ipsum</span><br> | |||||
| <span>Praes tinci sed</span> | |||||
| </li> | |||||
| <li class="w3-padding-16"> | |||||
| <span class="w3-large">Dorum</span><br> | |||||
| <span>Ultricies congue</span> | |||||
| </li> | |||||
| <li class="w3-padding-16 w3-hide-medium w3-hide-small"> | |||||
| <span class="w3-large">Mingsum</span><br> | |||||
| <span>Lorem ipsum dipsum</span> | |||||
| </li> | |||||
| </ul> | |||||
| </div> | |||||
| <hr> | |||||
| <!-- Labels / tags --> | |||||
| <div class="w3-card w3-margin"> | |||||
| <div class="w3-container w3-padding"> | |||||
| <h4>Tags</h4> | |||||
| </div> | |||||
| <div class="w3-container w3-white"> | |||||
| <p><span class="w3-tag w3-black w3-margin-bottom">Travel</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">New York</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">London</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">IKEA</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">NORWAY</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">DIY</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Ideas</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Baby</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Family</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">News</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Clothing</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Shopping</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Sports</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Games</span> | |||||
| </p> | |||||
| </div> | |||||
| </div> | |||||
| <!-- END Introduction Menu --> | |||||
| </div> | |||||
| @ -1,9 +0,0 @@ | |||||
| const utils = require('../utils/utils.js'); | |||||
| module.exports= | |||||
| { | |||||
| main: function(res, fileName) | |||||
| { | |||||
| return utils.include(res,"includes/sidebar.html"); | |||||
| } | |||||
| }; | |||||
| @ -1,11 +1,23 @@ | |||||
| var Promise = require('promise'); | |||||
| const sql = require('../utils/sql'); | |||||
| module.exports= | module.exports= | ||||
| { | { | ||||
| main: function(res, fileName) | main: function(res, fileName) | ||||
| { | { | ||||
| return new Promise(function(resolve, reject) | |||||
| { | |||||
| sql.getCategories().then(function(categories) | |||||
| { | |||||
| console.log(categories); | |||||
| for(var category in categories) | |||||
| { | |||||
| res.write(category); | |||||
| } | |||||
| }).then(function()) | |||||
| { | |||||
| resolve(); | |||||
| } | |||||
| }); | |||||
| } | } | ||||
| }; | }; | ||||
| @ -0,0 +1,62 @@ | |||||
| const Promise = require('promise'); | |||||
| const sql = require('../utils/sql'); | |||||
| module.exports= | |||||
| { | |||||
| /** | |||||
| * Responsible for querying the database and displaying all | |||||
| * categories that the blog has in the sidebar | |||||
| * | |||||
| * @param res | |||||
| * @return {*|Promise} | |||||
| */ | |||||
| main: function(res) | |||||
| { | |||||
| return new Promise(function(resolve, reject) | |||||
| { | |||||
| res.write("<div class=\"w3-col l4\">"); | |||||
| sql.getCategories().then(function(categories) | |||||
| { | |||||
| console.log(categories[0].name); | |||||
| console.log("cool beans"); | |||||
| // for(var category in categories) | |||||
| // { | |||||
| // console.log(category); | |||||
| // res.write(category.name); | |||||
| // } | |||||
| res.write("</div>"); | |||||
| resolve(); | |||||
| }) | |||||
| }); | |||||
| } | |||||
| }; | |||||
| /* | |||||
| <!-- Labels / tags --> | |||||
| <div class="w3-card w3-margin"> | |||||
| <div class="w3-container w3-padding"> | |||||
| <h4>Tags</h4> | |||||
| </div> | |||||
| <div class="w3-container w3-white"> | |||||
| <p><span class="w3-tag w3-black w3-margin-bottom">Travel</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">New York</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">London</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">IKEA</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">NORWAY</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">DIY</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Ideas</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Baby</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Family</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">News</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Clothing</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Shopping</span> | |||||
| <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Sports</span> <span class="w3-tag w3-light-grey w3-small w3-margin-bottom">Games</span> | |||||
| </p> | |||||
| </div> | |||||
| </div> | |||||
| */ | |||||
| @ -0,0 +1,70 @@ | |||||
| const Promise = require('promise'); | |||||
| module.exports= | |||||
| { | |||||
| main: function(res) | |||||
| { | |||||
| return new Promise(function(resolve, reject) | |||||
| { | |||||
| res.write("Popular posts"); | |||||
| resolve(); | |||||
| }) | |||||
| } | |||||
| }; | |||||
| /* | |||||
| <!-- Posts --> | |||||
| <div class="w3-card w3-margin"> | |||||
| <div class="w3-container w3-padding"> | |||||
| <h4>Popular Posts</h4> | |||||
| </div> | |||||
| <ul class="w3-ul w3-hoverable w3-white"> | |||||
| <li class="w3-padding-16"> | |||||
| <span class="w3-large">Lorem</span><br> | |||||
| <span>Sed mattis nunc</span> | |||||
| </li> | |||||
| <li class="w3-padding-16"> | |||||
| <span class="w3-large">Ipsum</span><br> | |||||
| <span>Praes tinci sed</span> | |||||
| </li> | |||||
| <li class="w3-padding-16"> | |||||
| <span class="w3-large">Dorum</span><br> | |||||
| <span>Ultricies congue</span> | |||||
| </li> | |||||
| <li class="w3-padding-16 w3-hide-medium w3-hide-small"> | |||||
| <span class="w3-large">Mingsum</span><br> | |||||
| <span>Lorem ipsum dipsum</span> | |||||
| </li> | |||||
| </ul> | |||||
| </div> | |||||
| <hr> | |||||
| */ | |||||
| @ -0,0 +1,11 @@ | |||||
| <div class="w3-card w3-margin w3-margin-top"> | |||||
| <div class="w3-container w3-white"> | |||||
| <h4><b>My Name</b></h4> | |||||
| <p>Just me, myself and I, exploring the universe of uknownment. I have a heart of love and a interest of lorem ipsum and mauris neque quam blog. I want to share my world with you.</p> | |||||
| </div> | |||||
| </div><hr> | |||||
| @ -0,0 +1,25 @@ | |||||
| const utils = require('../utils/utils.js'); | |||||
| var Promise = require('promise'); | |||||
| module.exports= | |||||
| { | |||||
| main: function(res) | |||||
| { | |||||
| return new Promise(function(resolve, reject) | |||||
| { | |||||
| res.write("<div class=\"w3-col l4\">"); | |||||
| utils.include(res,"sidebar/sidebar.html").then(function() | |||||
| { | |||||
| return require("../sidebar/popularPosts.js").main(res); | |||||
| }).then(function() | |||||
| { | |||||
| return require("../sidebar/categoriesSideBar.js").main(res); | |||||
| }).then(function() | |||||
| { | |||||
| res.write("</div>"); | |||||
| resolve(); | |||||
| }); | |||||
| }) | |||||
| } | |||||
| }; | |||||