aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDennis Eriksen <dennis.se@gmail.com>2013-04-12 12:49:33 +0200
committerDennis Eriksen <dennis.se@gmail.com>2013-04-12 12:49:33 +0200
commitf091b2ceb87efe64a69ba121eed20b1de210155d (patch)
treed99877f2e6f8833038dd3eb59f106974bd9dde79
parentadded favicon serving in app.js (diff)
downloadDivid-f091b2ceb87efe64a69ba121eed20b1de210155d.tar.gz
remove loginmenu if logged in
-rw-r--r--router.js5
-rw-r--r--views/test.ejs7
2 files changed, 9 insertions, 3 deletions
diff --git a/router.js b/router.js
index 2913c31..e77766a 100644
--- a/router.js
+++ b/router.js
@@ -36,7 +36,10 @@ module.exports = function(app) {
*/
app.get('/test', function(req, res) {
- res.render('test', { title: 'test' });
+ res.render('test', {
+ title: 'test',
+ loggedin: false
+ });
});
diff --git a/views/test.ejs b/views/test.ejs
index 946ebc4..03f85f5 100644
--- a/views/test.ejs
+++ b/views/test.ejs
@@ -20,6 +20,7 @@
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner" id="top-navbar">
<div class="container">
+ <% if (!loggedin) { %>
<div class="row collapse login-collapse">
<form action="/login" method="post" id="login-form" class="form-horizontal">
<div class="control-group">
@@ -46,6 +47,7 @@
</div>
</form>
</div>
+ <% } %>
<div class="row">
<button type="button" class="btn btn-navbar" data-toggle="collapse" data-target="nav-collapse">
<span class="icon-bar"></span>
@@ -55,12 +57,13 @@
<a class="brand" href="#">Divid</a>
<div class="nav-collapse collapse">
<ul class="nav">
- <li><a href="#login">Login</a></li>
<li><a href="#signup">signup</a></li>
<li><a href="#dashboard">Dashboard</a></li>
</ul>
</div>
- <a class="brand login" data-toggle="collapse" data-target=".login-collapse" href="#login">Logg inn</a>
+ <% if(!loggedin) { %><a class="brand login" data-toggle="collapse" data-target=".login-collapse" href="#login">Logg inn</a>
+ <% } else { %><a class="brand login">Logg ut</a>
+ <% } %>
</div>
</div>
</div>