Profile Picture
This commit is contained in:
1 parent
867770e14e
commit
43f662982e
365 files changed
+45560
-167
No files matched your search
@@ -0,0 +1,70 @@
|
||||
<div class="row mt-5">
|
||||
<div class="col-md-6 m-auto">
|
||||
<div class="card card-body">
|
||||
<h1 class="text-center mb-3">
|
||||
<i class="fas fa-user-plus"></i> Edit Account
|
||||
</h1>
|
||||
<% include ./partials/messages %>
|
||||
<form action="/users/edit" method="POST">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input
|
||||
type="name"
|
||||
id="name"
|
||||
name="name"
|
||||
class="form-control"
|
||||
placeholder="Enter Name"
|
||||
value="<%= typeof name != 'undefined' ? name : '' %>"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input
|
||||
type="email"
|
||||
id="email"
|
||||
name="email"
|
||||
class="form-control"
|
||||
placeholder="Enter Email"
|
||||
value="<%= typeof email != 'undefined' ? email : '' %>"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password">Current Password</label>
|
||||
<input
|
||||
type="password"
|
||||
id="oldPassword"
|
||||
name="oldPassword"
|
||||
class="form-control"
|
||||
placeholder="Current Password"
|
||||
value="<%= typeof password != 'undefined' ? password : '' %>"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password2">Confirm Password</label>
|
||||
<input
|
||||
type="password"
|
||||
id="newPassword"
|
||||
name="newPassword"
|
||||
class="form-control"
|
||||
placeholder="New Password"
|
||||
value="<%= typeof password2 != 'undefined' ? password2 : '' %>"
|
||||
/>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="password2">Confirm Password</label>
|
||||
<input
|
||||
type="password"
|
||||
id="newPassword2"
|
||||
name="newPassword2"
|
||||
class="form-control"
|
||||
placeholder="Confirm New Password"
|
||||
value="<%= typeof password2 != 'undefined' ? password2 : '' %>"
|
||||
/>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary btn-block">
|
||||
Save Changes
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
rel="stylesheet"
|
||||
href="https://bootswatch.com/4/journal/bootstrap.min.css"
|
||||
/>
|
||||
<title>XP-System Mock</title>
|
||||
<title>XP-System</title>
|
||||
</head>
|
||||
<body>
|
||||
<div class="container"><%- body %></div>
|
||||
|
||||
+5
-1
@@ -5,7 +5,7 @@
|
||||
<i class="fas fa-user-plus"></i> Register
|
||||
</h1>
|
||||
<% include ./partials/messages %>
|
||||
<form action="/users/register" method="POST">
|
||||
<form action="/users/register" method="POST" enctype="multipart/form-data">
|
||||
<div class="form-group">
|
||||
<label for="name">Name</label>
|
||||
<input
|
||||
@@ -17,6 +17,10 @@
|
||||
value="<%= typeof name != 'undefined' ? name : '' %>"
|
||||
/>
|
||||
</div>
|
||||
<div class='form-group'>
|
||||
<label for='image'>Upload Profile Picture</label>
|
||||
<input class='form-control' type="file" id="image" name="image" value="" required>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="email">Email</label>
|
||||
<input
|
||||
|
||||
@@ -1,14 +1,30 @@
|
||||
<style>
|
||||
#myProgress {
|
||||
width: 100%;
|
||||
position: relative;
|
||||
height: 150px;
|
||||
width: 150px;
|
||||
background-color: #ddd;
|
||||
border-style: solid;
|
||||
border-color: rgba(0, 0, 0, .5);
|
||||
}
|
||||
|
||||
#myBar {
|
||||
width: 1%;
|
||||
height: 30px;
|
||||
position: absolute;
|
||||
bottom: 0px;
|
||||
left: 0px;
|
||||
width: 145px;
|
||||
height: 1%;
|
||||
background-color: #46c7f2;
|
||||
}
|
||||
|
||||
#pro-pic {
|
||||
position: absolute;
|
||||
top: 24px;
|
||||
left: 24px;
|
||||
width: 100px;
|
||||
display: block;
|
||||
border-radius: 50px;
|
||||
}
|
||||
</style>
|
||||
<h1 class="mt-4">Student Dashboard</h1>
|
||||
<p class="lead mb-3">Welcome <%= user.name %></p>
|
||||
@@ -25,10 +41,13 @@
|
||||
<p stlye='text-align: right;' id='percent'></p>
|
||||
<div id="myProgress">
|
||||
<div id="myBar"></div>
|
||||
<img id='pro-pic' src='data:image/<%=user.image.contentType%>;base64,
|
||||
<%=user.image.data.toString('base64')%>'>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<a href="/users/logout" class="btn btn-secondary">Logout</a>
|
||||
<a href='/users/edit' class='btn btn-secondary'>Edit</a>
|
||||
<script>
|
||||
let xp = <%= user.xp %>;
|
||||
let currRank;
|
||||
@@ -74,7 +93,7 @@
|
||||
let progress = xp - currRankXP;
|
||||
let percent = (progress/total)*100;
|
||||
let elem = document.getElementById("myBar");
|
||||
elem.style.width = percent + '%';
|
||||
elem.style.height = percent + '%';
|
||||
document.getElementById('percent').innerHTML = progress + '|' + total;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user