IPost/views/otheruser.fr.html
Florian Krottendorfer 031a4f9f82 🌐 Language update from LingoHub 🤖
Project Name: IPost
Project Link: https://translate.lingohub.com/ipost-dot-tk/dashboard/ipost
User: Florian Krottendorfer

Easy language translations with LingoHub 🚀
2022-09-28 18:32:27 +00:00

38 lines
2.0 KiB
HTML

<!doctype html><html lang=""><head><meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>Page USERS</title>
</head>
<body> <%- newrelic %> <link rel="stylesheet" href="/css/style.css"/>
<link rel="stylesheet" href="/css/global.css"/><script src="/js/addnavbar.js" charset="utf-8"></script><script src="/js/warn_message.js" charset="utf-8"></script><header><h1 id="userName">UTILISATEUR</h1>
</header>
<main>
<div class="info_div"><img id="avatar" width="100" height="100"/><br/><h4 id="userBio">Bio : </h4><button id="mentionClick" onclick="mention()">Mentionnez cet utilisateur dans vos messages !</button></div>
</main><script type="text/javascript">
let other_username = window.location.pathname.split("/")[2]
console.log(other_username.search("@"),other_username);
if(other_username.search("@")==0)other_username=other_username.split("@")[1]
console.log(other_username);
async function getuser() {
let user = await (await fetch("/api/getotheruser?user="+other_username)).json()
document.getElementById('userName').innerText = `${(!user["error"] && "User: "+user.username) || "Error: "+user["error"]}`
document.getElementById('userBio').innerText = `${(!user["error"] && "Bio: " + decodeURIComponent(user.bio)) || ""}`
document.title = `${(!user["error"] && user.username+"'s Page") || "No such User!"}`
let avatar = user["avatar"]
if(avatar) {
avatar = "/avatars/"+avatar
} else {
avatar = "/images/default_avatar.png"
}
document.getElementById("avatar").src = avatar
if(user["error"]) {
document.body.removeChild(document.getElementById("mentionClick"))
}
}
getuser()
function mention() {
window.location.href = `/posts?message=@${other_username}\n`
}
</script></body>
</html>