diff options
author | Mateja <mail@matejamaric.com> | 2021-05-07 01:16:03 +0200 |
---|---|---|
committer | Mateja <mail@matejamaric.com> | 2021-05-07 01:16:03 +0200 |
commit | b99ff3787373aec8b0d679f301609361d39362e4 (patch) | |
tree | dc1846939632dc53c4836f8a609182bc2dff5a23 /views/layouts | |
parent | 5f58ad7e7b7546077556abd70fca44b296bb0c0c (diff) | |
download | node-playground-b99ff3787373aec8b0d679f301609361d39362e4.tar.gz node-playground-b99ff3787373aec8b0d679f301609361d39362e4.zip |
Change page layout if user is logged in.
Diffstat (limited to 'views/layouts')
-rw-r--r-- | views/layouts/main.handlebars | 51 |
1 files changed, 27 insertions, 24 deletions
diff --git a/views/layouts/main.handlebars b/views/layouts/main.handlebars index 41585e5..800d956 100644 --- a/views/layouts/main.handlebars +++ b/views/layouts/main.handlebars @@ -24,30 +24,33 @@ <a class="nav-link" href="/">Home</a> {{/if}} </li> - <li class="nav-item"> - {{#if newPost}} - <a class="nav-link active" aria-current="page" href="/new-post">New Post</a> - {{else}} - <a class="nav-link" href="/new-post">New Post</a> - {{/if}} - </li> - <li class="nav-item"> - {{#if login}} - <a class="nav-link active" aria-current="page" href="/login">Login</a> - {{else}} - <a class="nav-link" href="/login">Login</a> - {{/if}} - </li> - <li class="nav-item"> - {{#if register}} - <a class="nav-link active" aria-current="page" href="/register">Register</a> - {{else}} - <a class="nav-link" href="/register">Register</a> - {{/if}} - </li> - <li class="nav-item"> - <a class="nav-link" href="/logout">Logout</a> - </li> + {{#if auth}} + <li class="nav-item"> + {{#if newPost}} + <a class="nav-link active" aria-current="page" href="/new-post">New Post</a> + {{else}} + <a class="nav-link" href="/new-post">New Post</a> + {{/if}} + </li> + <li class="nav-item"> + <a class="nav-link" href="/logout">Logout</a> + </li> + {{else}} + <li class="nav-item"> + {{#if login}} + <a class="nav-link active" aria-current="page" href="/login">Login</a> + {{else}} + <a class="nav-link" href="/login">Login</a> + {{/if}} + </li> + <li class="nav-item"> + {{#if register}} + <a class="nav-link active" aria-current="page" href="/register">Register</a> + {{else}} + <a class="nav-link" href="/register">Register</a> + {{/if}} + </li> + {{/if}} </ul> </div> </div> |