This commit is contained in:
lingdocs 2021-08-21 23:17:43 +04:00
parent af1508986d
commit 2e7defbf61
2 changed files with 43 additions and 51 deletions

View File

@ -44,48 +44,49 @@
<div> <div>
<button type="submit" class="btn btn-primary">Update Profile</button> <button type="submit" class="btn btn-primary">Update Profile</button>
</div> </div>
<% if (user.email) { %>
<h4 class="mt-3">Password:</h4>
<% } %>
<div id="password-change-form" style="display: none;">
<% if (user.password) { %>
<div id="old-password-form">
<% } else { %>
<div id="old-password-form" style="display: none;">
<% } %>
<div class="mb-3 mt-3">
<label for="oldPassword" class="form-label">Old Password:</label>
<input type="password" class="form-control" id="oldPassword">
</div>
<div class="small text-left" id="forgot-password">
<a href="" tabindex="-1">Forgot Old Password?</a>
</div>
</div>
<div class="mb-3 mt-3">
<label for="password" class="form-label">New Password:</label>
<input type="password" class="form-control" id="password" />
</div>
<div class="mb-4 mt-3">
<label for="confirmPassword" class="form-label">Confirm New Password:</label>
<input type="password" class="form-control" id="confirmPassword">
</div>
</div>
<div id="password-change-result" style="display: none;" class="alert alert-info mt-3 mb-4" role="alert">
</div>
<% if (user.email) { %>
<div class="d-flex flex-row justify-content-between mt-4 mb-3">
<button type="button" id="password-change-button" class="btn btn-secondary">
<% if (user.password) { %>
Change
<% } else { %>
Add
<% } %>
Password
</button>
<button type="button" style="display: none;" id="cancel-password-change-button" class="btn btn-light">Cancel</button>
</div>
<% } %>
</form> </form>
<h5>Account Level: <%= user.level %></h5>
<% if (user.email) { %>
<h4 class="mt-3">Password:</h4>
<% } %>
<div id="password-change-form" style="display: none;">
<% if (user.password) { %>
<div id="old-password-form">
<% } else { %>
<div id="old-password-form" style="display: none;">
<% } %>
<div class="mb-3 mt-3">
<label for="oldPassword" class="form-label">Old Password:</label>
<input type="password" class="form-control" id="oldPassword">
</div>
<div class="small text-left" id="forgot-password">
<a href="" tabindex="-1">Forgot Old Password?</a>
</div>
</div>
<div class="mb-3 mt-3">
<label for="password" class="form-label">New Password:</label>
<input type="password" class="form-control" id="password" />
</div>
<div class="mb-4 mt-3">
<label for="confirmPassword" class="form-label">Confirm New Password:</label>
<input type="password" class="form-control" id="confirmPassword">
</div>
</div>
<div id="password-change-result" style="display: none;" class="alert alert-info mt-3 mb-4" role="alert">
</div>
<% if (user.email) { %>
<div class="d-flex flex-row justify-content-between mt-4 mb-3">
<button type="button" id="password-change-button" class="btn btn-secondary">
<% if (user.password) { %>
Change
<% } else { %>
Add
<% } %>
Password
</button>
<button type="button" style="display: none;" id="cancel-password-change-button" class="btn btn-light">Cancel</button>
</div>
<% } %>
<h4 class="mb-2">Linked Accounts:</h4> <h4 class="mb-2">Linked Accounts:</h4>
<div class="mb-4"> <div class="mb-4">
<% if (user.google) { %> <% if (user.google) { %>

View File

@ -199,12 +199,3 @@ export async function deleteFromLocalDb(type: LocalDbType, id: string | string[]
} }
localDb.refresh(); localDb.refresh();
} }
function stringToHex(str: string) {
const arr1 = [];
for (let n = 0, l = str.length; n < l; n ++) {
const hex = Number(str.charCodeAt(n)).toString(16);
arr1.push(hex);
}
return arr1.join('');
}