odin-codespace/file-uploader/src/views/main.ejs
2025-06-14 20:54:36 -04:00

34 lines
953 B
Text

<%- include('partials/header') %>
<body>
<% if(currentUser) { %>
<div class="container flex app">
<aside class="nav">
<p> Hello <%= currentUser.username %> </p>
<a href="/auth/logout">sign out</a>
<%- include('partials/newDirectory') %>
<%- include('partials/fileUpload') %>
</aside>
<main>
<div class="container">
<%- include('partials/parentDirectories') %>
<%- include('partials/directoryListing') %>
</div>
</main>
</div>
<% } else { %>
<main>
<form action="/auth/login" method="post">
<label for="username">Username</label>
<input type="text" name="username">
<label for="password">Password</label>
<input type="password" name="password" id="password">
<button type="submit">Submit</button>
<a href="/auth/register">Click here to register</a>
</form>
</main>
<% } %>
<%- include('partials/footer') %>