Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions routes/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ module.exports = function(app){
logger.log('Serving request for url [GET]' + req.route.path)
Post.getAll(function(err, allPosts){
if(!err && allPosts){
res.render('index', {'allPosts' : allPosts});
res.render('index', {'allPosts' : allPosts, 'activePage': 'home'});
}else{
util.log('Error fetching posts from database : ' + err);
res.render('error');
Expand Down Expand Up @@ -148,7 +148,7 @@ module.exports = function(app){
app.get('/admin', getAllMeta, function(req, res){
util.log('Serving request for url [GET] ' + req.route.path);
if(req.session.user){
res.render('post', {'postsList' : req.postsList});
res.render('post', {'postsList' : req.postsList, 'activePage': 'admin'});
}else{
res.redirect('/');
}
Expand Down Expand Up @@ -255,11 +255,11 @@ module.exports = function(app){

app.get('/contact', function(req, res){
util.log('Serving request for url[GET] ' + req.route.path);
res.render('contact');
res.render('contact', {'activePage': 'contact'});
});

app.get('/about', function(req, res){
util.log('Serving request for url[GET] ' + req.route.path);
res.render('about');
res.render('about', {'activePage' : 'about'});
});
};
2 changes: 1 addition & 1 deletion views/footer.jade
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
div#footer.footer
p © nodeblox 2011
p © nodeblox 2011-2013
script(data-main="/js/main", src="/js/require.js")
1 change: 1 addition & 0 deletions views/signupErrorModal.jade
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
div#signup-error-modal.modal.hide
div.modal-header
a.close(href='#', data-dismiss="modal") x
h3 Error
div.modal-body
div.alert.alert-error
strong Oh snap !
Expand Down
34 changes: 25 additions & 9 deletions views/topbar.jade
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,38 @@ div.navbar.navbar-fixed-top
a.brand(href='/') nodeBlox
div.nav-collapse
ul.nav
li.active
a(href='/') Home
li
a(href='/about') About
li
a(href='/contact') Contact
-if(session.user)
-if(activePage == 'home')
li.active
a(href='/') Home
-else
li
a(href='/') Home
-if(activePage == 'about')
li.active
a(href='/about') About
-else
li
a(href='/admin') Admin
a(href='/about') About
-if(activePage == 'contact')
li.active
a(href='/contact') Contact
-else
li
a(href='/contact') Contact
-if(session.user)
-if(activePage == 'admin')
li.active
a(href='/admin') Admin
-else
li
a(href='/admin') Admin
-if(session.user)
div#logoutsection.pull-right
a#logout-btn.btn.btn-info.pull-right.top-bar-form-button(href='/logout') Logout
p#loginprompt.pull-right.login-prompt #{session.user.username}
small logged In
-else
//a#signup-btn.btn.pull-right.top-bar-form-button(href='#signup-modal', data-toggle="modal") Sign Up
a#signup-btn.btn.pull-right.top-bar-form-button(href='#signup-modal', data-toggle="modal") Sign Up
form.pull-right.form-horizontal.top-bar-form(method="post", id="loginForm")
input.input-small.top-bar-form-textbox(id="username", type="text", name="User", placeholder="Username")
input.input-small.top-bar-form-textbox(id="password", type="password", name="Password", placeholder="Password")
Expand Down