diff --git a/res/forum/script.js b/res/forum/script.js
index b129dcb..55f1cea 100644
--- a/res/forum/script.js
+++ b/res/forum/script.js
@@ -31,8 +31,10 @@ function selection(type, value)
});
}
-function inject_info(id, username, postfix)
+async function inject_info(id, username, postfix)
{
+ let am_i_admin = await is_admin();
+
$.ajax
({
url: "./res/forum/api/user_info.php?username=" + username,
@@ -42,10 +44,10 @@ function inject_info(id, username, postfix)
let sex_select = await selection("sex", result.sex);
let output =
- `Uživatelské jméno:
- Přezdívka:
- Admin: ${admin_select}
- Pohlaví: ${sex_select}
+ ((am_i_admin) ? `Uživatelské jméno:
` : ``) +
+ `Přezdívka:
` +
+ ((am_i_admin) ? `Admin: ${admin_select}
` : ``) +
+ `Pohlaví: ${sex_select}
Bio:
`;
$(id).html(output + postfix);