express-message-board/views/newmsg.ejs
ak fa3cebba04 functioning version
still in process of finding new host
for now, available on demand via ngrok
2023-09-23 12:17:32 -07:00

74 lines
2.2 KiB
Text

<!DOCTYPE html>
<html>
<head>
<title>b0ard - New Message</title>
<link rel="stylesheet" href="/styles/css/bootstrap.min.css" />
<link rel="stylesheet" href="/stylesheets/index.css" />
</head>
<body class="bg-dark text-light">
<% if (errors) { errors.forEach(error => { %>
<p class="text-center bg-danger"><%= error.msg %></p>
<% }) } %>
<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"
>
<div class="d-flex align-items-center gap-3">
<img
src="data:image/image/png;base64,
<%=user.avatar.toString('base64')%>"
width="24px"
/>
<%= user.username %>
</div>
</a>
</header>
<div class="d-flex flex-column py-4 px-4 align-items-center">
<h2 class="mb-4">New Message</h2>
<form
class="d-flex flex-column align-items-center w-50"
method="post"
action="/msg/new"
>
<div class="input-group mb-4" data-bs-theme="dark">
<span class="input-group-text" id="to-desc">To:</span>
<% if (to) { %>
<input
type="text"
class="form-control"
aria-label="recipient"
aria-describedby="to-desc"
name="to"
value="<%= to %>"
/>
<% } else { %>
<input
type="text"
class="form-control"
aria-label="recipient"
aria-describedby="to-desc"
name="to"
/>
<% } %>
</div>
<div class="input-group mb-4" data-bs-theme="dark">
<span class="input-group-text" id="text-desc">Message:</span>
<textarea
class="form-control"
aria-label="text"
aria-describedby="text-desc"
name="text"
></textarea>
</div>
<button type="submit" class="btn btn-outline-light px-4 py-2">
Send Message
</button>
</form>
</div>
</body>
</html>