using the user_info json output

This commit is contained in:
Václav Šmejkal 2024-05-21 20:22:47 +02:00
parent 08d67f19a2
commit 859b3d5f07
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -42,7 +42,25 @@
url: "./res/forum/api/user_info.php?username=" + event.target.innerHTML, url: "./res/forum/api/user_info.php?username=" + event.target.innerHTML,
success: function(result) success: function(result)
{ {
$("#right_panel").html(result + right_panel_buffer); var sex_codes =
{
0: "Nespecifikováno",
1: "Muž",
2: "Žena",
9: "Jiné",
default: "???"
};
let sex = sex_codes[result.sex] || sex_codes.default;
let output =
`Uživatelské jméno: ${result.username}<br>
Přezdívka: ${result.nickname}<br>
Admin: ${result.admin}<br>
Pohlaví: ${sex}<br>
Bio: ${result.bio}<br>`;
$("#right_panel").html(output + right_panel_buffer);
} }
}); });
}); });