mirror of
https://github.com/xfarrow/blink
synced 2025-03-27 13:10:05 +01:00
Update userprofile.html
This commit is contained in:
parent
b4b70b524d
commit
09dfcc0069
@ -10,7 +10,7 @@
|
|||||||
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body style="display: none;">
|
||||||
<div class="topnav">
|
<div class="topnav">
|
||||||
<a class="active" href="#home">Home</a>
|
<a class="active" href="#home">Home</a>
|
||||||
<a href="#contact">Discover</a>
|
<a href="#contact">Discover</a>
|
||||||
@ -24,7 +24,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="container" id="container" style="display: none;">
|
<div class="container" style="display: none;">
|
||||||
<div class="edit-badge" style="display: none;" id="editBadge" onclick="editProfile()">Edit</div>
|
<div class="edit-badge" style="display: none;" id="editBadge" onclick="editProfile()">Edit</div>
|
||||||
<header>
|
<header>
|
||||||
<img src="../content/profile-picture-example.jpg" alt="Profile Picture" class="profile-picture">
|
<img src="../content/profile-picture-example.jpg" alt="Profile Picture" class="profile-picture">
|
||||||
@ -74,7 +74,6 @@
|
|||||||
|
|
||||||
// Retrieving the logged in user's profile
|
// Retrieving the logged in user's profile
|
||||||
if (!idToDisplay || idToDisplay === 'me') {
|
if (!idToDisplay || idToDisplay === 'me') {
|
||||||
document.getElementById('editBadge').style.display = 'block'; // show edit button
|
|
||||||
const token = getCookie('token');
|
const token = getCookie('token');
|
||||||
// Check whether the token exists
|
// Check whether the token exists
|
||||||
if (!token) {
|
if (!token) {
|
||||||
@ -86,6 +85,7 @@
|
|||||||
"authorization": token
|
"authorization": token
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
document.getElementById('editBadge').style.display = 'block'; // show edit button
|
||||||
} else {
|
} else {
|
||||||
response = await fetch(`${API_URL}/persons/${idToDisplay}/details`, {
|
response = await fetch(`${API_URL}/persons/${idToDisplay}/details`, {
|
||||||
headers: {
|
headers: {
|
||||||
@ -97,7 +97,7 @@
|
|||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
if (response.ok) {
|
if (response.ok) {
|
||||||
populateFields(data.display_name, data.email, data.about_me, data.qualification);
|
populateFields(data.display_name, data.email, data.about_me, data.qualification);
|
||||||
document.getElementById('container').style.display = 'block'; // Show page
|
document.body.style.display = 'block'; // Show page
|
||||||
} else if (response.status == 401) {
|
} else if (response.status == 401) {
|
||||||
window.location.href = 'login.html';
|
window.location.href = 'login.html';
|
||||||
} else {
|
} else {
|
||||||
@ -117,7 +117,7 @@
|
|||||||
alert('Editing');
|
alert('Editing');
|
||||||
}
|
}
|
||||||
|
|
||||||
function onSearchButtonClick(){
|
function onSearchButtonClick() {
|
||||||
alert('Searching for something...');
|
alert('Searching for something...');
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user