express-message-board/views/edituser.ejs
ak f36b48f4ce progress update
image uploading works
hosted at deta space
2023-09-20 18:00:32 -07:00

81 lines
2.6 KiB
Text

<!DOCTYPE html>
<html>
<head>
<title>b0ard - Editing <%= user.username %></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">Editing <%= user.username %></h2>
<p>Required fields are labeled *</p>
<form
class="d-flex flex-column align-items-center w-50"
method="post"
enctype="multipart/form-data"
>
<div class="input-group mb-4" data-bs-theme="dark">
<span class="input-group-text" id="oldpassword-desc"
>Current Password*:</span
>
<input
type="password"
class="form-control"
aria-label="current password"
aria-describedby="oldpassword-desc"
name="oldpassword"
/>
</div>
<div class="input-group mb-4" data-bs-theme="dark">
<span class="input-group-text" id="password-desc">New Password:</span>
<input
type="password"
class="form-control"
aria-label="new password"
aria-describedby="password-desc"
name="password"
/>
</div>
<div class="input-group mb-4" data-bs-theme="dark">
<span class="input-group-text" id="avatar-desc">New Avatar:</span>
<input
type="file"
class="form-control"
aria-label="avatar"
aria-describedby="avatar-desc"
name="avatar"
/>
</div>
<button type="submit" class="btn btn-outline-light px-4 py-2">
Submit
</button>
<div class="pb-4"></div>
<a href="delete" type="button" class="btn btn-danger px-4 py-2">
Delete <%= user.username %>
</a>
</form>
</div>
</body>
</html>