not showing admin and username seleciton to user

it wont do anything so yk
This commit is contained in:
Václav Šmejkal 2024-05-22 21:20:46 +02:00
parent 69824f6886
commit 6b08b62510
Signed by: ENGO150
GPG Key ID: 4A57E86482968843

View File

@ -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 $.ajax
({ ({
url: "./res/forum/api/user_info.php?username=" + username, 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 sex_select = await selection("sex", result.sex);
let output = let output =
`Uživatelské jméno: <input id="username" class="editable" type="text" value="${result.username}"><br> ((am_i_admin) ? `Uživatelské jméno: <input id="username" class="editable" type="text" value="${result.username}"><br>` : ``) +
Přezdívka: <input id="nickname" class="editable" type="text" value="${result.nickname}"><br> `Přezdívka: <input id="nickname" class="editable" type="text" value="${result.nickname}"><br>` +
Admin: ${admin_select}<br> ((am_i_admin) ? `Admin: ${admin_select}<br>` : ``) +
Pohlaví: ${sex_select}<br> `Pohlaví: ${sex_select}<br>
Bio: <input id="bio" class="editable" type="text" value="${result.bio}"><br>`; Bio: <input id="bio" class="editable" type="text" value="${result.bio}"><br>`;
$(id).html(output + postfix); $(id).html(output + postfix);