diff --git a/frontend/normal_user/_main page/pojedynczy_turniej/app.js b/frontend/normal_user/_main page/pojedynczy_turniej/app.js index 292d920..82acd56 100644 --- a/frontend/normal_user/_main page/pojedynczy_turniej/app.js +++ b/frontend/normal_user/_main page/pojedynczy_turniej/app.js @@ -10,6 +10,33 @@ async function showTournaments() { } } +function checkRole() { + if (localStorage.getItem("token") !== null) { + + fetch('https://dragonmaster.pl/inz/user', { + headers: { + Authorization: ("Bearer " + localStorage.getItem("token")) + } + }) + .then(res => res.json()) + .then(json => { + if (json['role'] == '1') { + document.getElementById("zapisy").style.display = "none"; + document.getElementById("drabinka").style.display = "none"; + } + else { + document.getElementById("zapisy").style.display = ''; + document.getElementById("drabinka").style.display = ''; + } + }) + } + else { + document.getElementById("zapisy").style.display = "none"; + document.getElementById("drabinka").style.display = "none"; + } + +} + function logout() { localStorage.removeItem('token'); location.reload(); diff --git a/frontend/normal_user/_main page/pojedynczy_turniej/css/single_tournament.css b/frontend/normal_user/_main page/pojedynczy_turniej/css/single_tournament.css index 319698e..464b17b 100644 --- a/frontend/normal_user/_main page/pojedynczy_turniej/css/single_tournament.css +++ b/frontend/normal_user/_main page/pojedynczy_turniej/css/single_tournament.css @@ -58,13 +58,10 @@ flex-direction: row; justify-content: center; align-items: center; - padding: 6px 15px; - gap: 10px; - - margin-top: 1%; + margin-top: 0.5%; /*position: absolute;*/ - width: 73px; + width: 90px; height: 29px; /* PFP GREEN */ diff --git a/frontend/normal_user/_main page/pojedynczy_turniej/index.html b/frontend/normal_user/_main page/pojedynczy_turniej/index.html index 856bd0e..bc54d98 100644 --- a/frontend/normal_user/_main page/pojedynczy_turniej/index.html +++ b/frontend/normal_user/_main page/pojedynczy_turniej/index.html @@ -10,7 +10,7 @@ -
+