From 859b3d5f07350c9783d4ea460ebb63ea57d28729 Mon Sep 17 00:00:00 2001 From: ENGO150 Date: Tue, 21 May 2024 20:22:47 +0200 Subject: [PATCH] using the user_info json output --- res/forum/admin.html | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/res/forum/admin.html b/res/forum/admin.html index d07287f..33917b4 100644 --- a/res/forum/admin.html +++ b/res/forum/admin.html @@ -42,7 +42,25 @@ url: "./res/forum/api/user_info.php?username=" + event.target.innerHTML, 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}
+ Přezdívka: ${result.nickname}
+ Admin: ${result.admin}
+ Pohlaví: ${sex}
+ Bio: ${result.bio}
`; + + $("#right_panel").html(output + right_panel_buffer); } }); });