142 lines
11 KiB
Plaintext
142 lines
11 KiB
Plaintext
<%- include("./partials/fileHeader") %>
|
|
<%- include("./partials/header") %>
|
|
|
|
<main class="pt-24">
|
|
<!-- Confirm delete account modal -->
|
|
<dialog id="delete-warning-modal" class="w-lg mx-auto bg-transparent p-8 mt-10 rounded-lg shadow-md">
|
|
<div class="relative p-4 w-full max-w-md h-full md:h-auto">
|
|
<!-- Modal content -->
|
|
<div class="relative p-4 text-center bg-white rounded-lg shadow dark:bg-gray-800 sm:p-5">
|
|
<form method="dialog">
|
|
<button type="submit" class="text-gray-400 absolute top-2.5 right-2.5 bg-transparent hover:bg-gray-200 hover:text-gray-900 rounded-lg text-sm p-1.5 ml-auto inline-flex items-center dark:hover:bg-gray-600 dark:hover:text-white">
|
|
<svg aria-hidden="true" class="w-5 h-5" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z" clip-rule="evenodd"></path></svg>
|
|
<span class="sr-only">Close modal</span>
|
|
</button>
|
|
</form>
|
|
<svg class="text-gray-400 dark:text-gray-500 w-11 h-11 mb-3.5 mx-auto" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" d="M9 2a1 1 0 00-.894.553L7.382 4H4a1 1 0 000 2v10a2 2 0 002 2h8a2 2 0 002-2V6a1 1 0 100-2h-3.382l-.724-1.447A1 1 0 0011 2H9zM7 8a1 1 0 012 0v6a1 1 0 11-2 0V8zm5-1a1 1 0 00-1 1v6a1 1 0 102 0V8a1 1 0 00-1-1z" clip-rule="evenodd"></path></svg>
|
|
<p class="mb-4 text-gray-500 dark:text-gray-300">Are you sure you want to delete you account? This process cannot be undone.</p>
|
|
<div class="flex justify-center items-center space-x-4">
|
|
<div style="width: 100%;">
|
|
<form method="dialog" style="width: 100%;">
|
|
<button
|
|
type="submit"
|
|
class="py-2 px-3 text-sm font-medium text-gray-500 bg-white rounded-lg border border-gray-200 hover:bg-gray-100 focus:ring-4 focus:outline-none focus:ring-primary-300 hover:text-gray-900 focus:z-10 dark:bg-gray-700 dark:text-gray-300 dark:border-gray-500 dark:hover:text-white dark:hover:bg-gray-600 dark:focus:ring-gray-600"
|
|
>
|
|
No, cancel
|
|
</button>
|
|
</form>
|
|
</div>
|
|
<div style="width: 100%;">
|
|
<form method="POST" action="/deleteUser">
|
|
<input id="id" name="id" type="text" hidden value="<%= user._id %>">
|
|
<button
|
|
type="submit"
|
|
class="py-2 px-3 text-sm font-medium text-center text-white bg-red-600 rounded-lg hover:bg-red-700 focus:ring-4 focus:outline-none focus:ring-red-300 dark:bg-red-500 dark:hover:bg-red-600 dark:focus:ring-red-900"
|
|
>
|
|
Yes, I'm sure
|
|
</button>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</dialog>
|
|
|
|
<h2 class="ml-11 mt-5 mb-6 text-xl font-semibold mb-4 text-white">Welcome <%= user.name %></h2>
|
|
|
|
<% if (errMessage != "") { %>
|
|
<div class="max-w-md mx-auto mb-10 rounded-lg shadow-md text-white font-bold bg-red-400 py-4 text-center"><%= errMessage %></div>
|
|
<% } %>
|
|
|
|
<div class="max-w-md mx-auto bg-white p-8 mb-10 rounded-lg shadow-md">
|
|
<div class="flex flex-row justify-between">
|
|
<h3 class="pt-2 pr-2 pb-2">Account settings</h3>
|
|
<button id="edit-account" onclick="unlockAccount()" class="py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Edit</button>
|
|
</div>
|
|
<form action="/updateAccount" method="post" class="space-y-4 mt-4" id="account-form">
|
|
|
|
<label for="email" class="block text-sm font-medium text-gray-700">Email</label>
|
|
<input id="email" disabled type="email" name="email" value="<%= user.email %>" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
|
|
<label for="name" class="block text-sm font-medium text-gray-700">Name</label>
|
|
<input id="name" disabled type="text" name="name" value="<%= user.name %>" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
|
|
<label for="password" class="block text-sm font-medium text-gray-700">New password</label>
|
|
<input id="password" disabled type="password" name="password" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
|
|
<label for="repassword" class="block text-sm font-medium text-gray-700">Confirm new password</label>
|
|
<input id="repassword" disabled type="password" name="repassword" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
|
|
<div>
|
|
<button id="save-account" disabled type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-not-allowed">Save</button>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
|
|
<div class="flex flex-row justify-center mx-auto p8">
|
|
<button
|
|
type="submit"
|
|
class="w-xs p-3 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-red-600 hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 cursor-pointer"
|
|
onclick="document.getElementById('delete-warning-modal').showModal()"
|
|
>
|
|
Delete Account
|
|
</button>
|
|
</div>
|
|
|
|
<!--
|
|
<div class="mb-10 max-w-md mx-auto bg-white p-8 rounded-lg shadow-md">
|
|
<div class="flex flex-row justify-between">
|
|
<h3 class="pt-2 pr-2 pb-2">Personal information</h3>
|
|
<button onclick="unlockPersonal()" class="py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">Edit</button>
|
|
</div>
|
|
<form action="/updatePersonal" method="post" class="space-y-4" id="personal-form">
|
|
<div>
|
|
<label for="dob" class="block text-sm font-medium text-gray-700">Date of Birth</label>
|
|
<input id="dob" disabled type="date" name="dob" class="mt-1 block w-full px-3 py-2 border border-gray-300 rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
</div>
|
|
<div>
|
|
<label for="education" class="block text-sm font-medium text-gray-700">Education</label>
|
|
<select disabled name="education" id="education" class="mt-1 block w-full px-3 py-2 border border-gray-300 bg-white rounded-md shadow-sm focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
<option value="primary">Primary (Elementary)</option>
|
|
<option value="secondary">Secondary (High School)</option>
|
|
<option value="tertiary">Tertiary (College/University)</option>
|
|
<option value="postgraduate">Postgraduate (Master's/PhD)</option>
|
|
</select>
|
|
</div>
|
|
|
|
<div>
|
|
<label class="block text-sm font-medium text-gray-700">Marital Status</label>
|
|
<div class="mt-1 space-x-4">
|
|
<label class="inline-flex items-center">
|
|
<input disabled id="ms-single" type="radio" name="maritalStatus" value="single" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
<span class="ml-2 text-sm text-gray-700">Single</span>
|
|
</label>
|
|
<label class="inline-flex items-center">
|
|
<input disabled id="ms-married" type="radio" name="maritalStatus" value="married" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
<span class="ml-2 text-sm text-gray-700">Married</span>
|
|
</label>
|
|
<label class="inline-flex items-center">
|
|
<input disabled id="ms-divorced" type="radio" name="maritalStatus" value="divorced" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
<span class="ml-2 text-sm text-gray-700">Divorced</span>
|
|
</label>
|
|
<label class="inline-flex items-center">
|
|
<input disabled id="ms-widowed" type="radio" name="maritalStatus" value="widowed" class="form-radio h-4 w-4 text-indigo-600 border-gray-300 focus:ring-indigo-500 disabled:border-gray-200 disabled:bg-gray-50 disabled:text-gray-500 disabled:shadow-none">
|
|
<span class="ml-2 text-sm text-gray-700">Widowed</span>
|
|
</label>
|
|
</div>
|
|
</div>
|
|
|
|
<div>
|
|
<button id="save-personal" disabled type="submit" class="w-full flex justify-center py-2 px-4 border border-transparent rounded-md shadow-sm text-sm font-medium text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 cursor-not-allowed">Save</button>
|
|
</div>
|
|
</form>
|
|
</div> -->
|
|
|
|
<div class="mt-24"></div>
|
|
</main>
|
|
|
|
<script src="/static/scripts/profile.js"></script>
|
|
|
|
<%- include("./partials/navBar") %>
|
|
<%- include("./partials/scriptLoader") %>
|
|
<%- include("./partials/footer") %> |