From 781c45fe4961bc6f1bdf3df3993911bc9d5f8f6d Mon Sep 17 00:00:00 2001 From: Arek Date: Sun, 19 Jun 2022 22:50:57 +0200 Subject: [PATCH] fix: :bug: fix some views --- .../_main page/pojedynczy_turniej/app.js | 27 +++++++++++++++++++ .../css/single_tournament.css | 7 ++--- .../_main page/pojedynczy_turniej/index.html | 6 ++--- frontend/normal_user/app.js | 2 +- .../dodawanie turnieju/index.html | 3 ++- 5 files changed, 35 insertions(+), 10 deletions(-) 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 @@ - +
diff --git a/frontend/normal_user/app.js b/frontend/normal_user/app.js index ea262d9..98f2839 100644 --- a/frontend/normal_user/app.js +++ b/frontend/normal_user/app.js @@ -96,7 +96,7 @@ async function renderTournaments(organiserTournament) { ${tournament.place} ${tournament.from} do ${tournament.to} - + diff --git a/frontend/panel_organizatora/dodawanie turnieju/index.html b/frontend/panel_organizatora/dodawanie turnieju/index.html index 3ad87d3..523b618 100644 --- a/frontend/panel_organizatora/dodawanie turnieju/index.html +++ b/frontend/panel_organizatora/dodawanie turnieju/index.html @@ -119,7 +119,8 @@ - +