aboutsummaryrefslogtreecommitdiff
path: root/views
diff options
context:
space:
mode:
Diffstat (limited to 'views')
-rw-r--r--views/home.handlebars4
-rw-r--r--views/layouts/main.handlebars51
2 files changed, 30 insertions, 25 deletions
diff --git a/views/home.handlebars b/views/home.handlebars
index b0b7d34..7f48f65 100644
--- a/views/home.handlebars
+++ b/views/home.handlebars
@@ -10,7 +10,9 @@
<div class="card-text">
{{{this.text}}}
</div>
- <a href="/remove-post/{{this._id}}" class="badge float-end">Remove</a>
+ {{#if auth}}
+ <a href="/remove-post/{{this._id}}" class="badge float-end">Remove</a>
+ {{/if}}
</div>
</div>
{{/each}}
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>