express-message-board/views/index.ejs
ak d5bf0927a6 progress update
everything tested and functional except direct messages
2023-09-19 22:54:57 -07:00

65 lines
2 KiB
Text

<!DOCTYPE html>
<html>
<head>
<title>b0ard</title>
<link rel="stylesheet" href="/styles/css/bootstrap.min.css" />
<link rel="stylesheet" href="/stylesheets/index.css" />
</head>
<body class="bg-dark text-light min-vh-100">
<header
class="d-flex w-100 align-items-center justify-content-between border-bottom mb-2 border-light py-2 px-4 w-100"
>
<a href="/" class="logotext p-0 m-0 fs-1">b0ard</a>
<a
href="/user/<%= user._id %>"
type="button"
class="btn btn-outline-light px-4 py-2"
>
<%= user.username %>
</a>
</header>
<div class="d-flex flex-row p-4 w-100 justify-content-between">
<div class="d-flex flex-column w-50">
<center>
<h1 class="fs-4">Direct Messages:</h1>
</center>
<% DMs.forEach(DM => { %>
<a
href="/msg/<%= DM._id %>"
type="button"
class="btn btn-outline-light p-2"
>
<p class="p-0 m-0">From: <%= DM.from %></p>
<p class="p-0 m-0">Sent: <%= DM.date.toDateString() %></p>
<p>Last Updated: <%= DM.updated %></p>
<p><%= DM.text %></p>
</a>
<div class="pb-4"></div>
<% }) %>
</div>
<div class="d-flex flex-column w-50">
<center>
<h1 class="fs-4">Public Messages:</h1>
</center>
<% allChat.forEach(chat => { %>
<a
href="/msg/<%= chat._id %>"
type="button"
class="btn btn-outline-light p-2"
>
<p class="p-0 m-0">From: <%= chat.from %></p>
<p class="p-0 m-0">Sent: <%= chat.date.toDateString() %></p>
<p>Last Updated: <%= chat.updated.toDateString() %></p>
<p><%= chat.text %></p>
</a>
<div class="pb-4"></div>
<% }) %>
</div>
</div>
<center>
<a href="/msg/new" type="button" class="btn btn-outline-light px-4 py-2">
+ New Message
</a>
</center>
</body>
</html>