aboutsummaryrefslogtreecommitdiff
path: root/views/partials/sidebar.ejs
blob: 0cd27160062ee754606063bb41db1ed1166c8848 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
<div class="sidebar">
    <a href="/" class="title">
        <img src="<%= domain %>/images/logo.png" alt="That Computer Scientist Logo" width="10rem" height="3.23rem">
    <!-- Login Box -->
    </a>
    <% if (locals.username) { %>
        <div class="login-box">
            <p>Welcome, <%= username %>!</p>
            <a href="<%= domain %>/auth/logout">Logout</a>
        </div>
    <% } else { %>
        <form method="post" action="<%= domain %>/auth/login">
            <fieldset>
                <legend>Login Area</legend>
                <label for="username">Username</label>
                <input type="text" id="username" name="username" placeholder="Username" autocomplete="off">
                <label for="password">Password</label>
                <input type="password" id="password" name="password" placeholder="Password">
                <% if (locals.messages) { %>
                    <p class="error"><%= messages.error %></p>
                <% } %>
                <input type="submit" value="Login">
            </fieldset>
        </form>
    <% } %>  
    <br>
    <fieldset>
        <legend>Navigation</legend>
        <nav>
            <ul>
                <li><a href="/">Home</a></li>
                <li><a href="/about">About</a></li>
                <li><a href="/contact">Contact</a></li>
                <li><a href="/blog">Blog</a></li>
                <% if (locals.username) { %>
                    <li><a href="/account">My Account</a></li>
                <% } else { %>
                    <li><a href="/register">Register</a></li>
                <% } %>
            </ul>
        </nav>
    </fieldset>
</div>