fix: 🐛 fix some views
This commit is contained in:
parent
86556b76bb
commit
781c45fe49
@ -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();
|
||||
|
@ -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 */
|
||||
|
@ -10,7 +10,7 @@
|
||||
<script type="text/javascript" src="app.js"></script>
|
||||
</head>
|
||||
|
||||
<body onload="renderTournaments();logoutVisibility(); loginVisibility();">
|
||||
<body onload="renderTournaments();logoutVisibility(); loginVisibility(); checkRole();">
|
||||
<header>
|
||||
<div class="logoBox">
|
||||
<a class="header_link" href="../../index.html"><img class="logo" src="../../../_global/logo.svg"
|
||||
@ -51,8 +51,8 @@
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="#">Informacje</a></li>
|
||||
<li><a href="zapisy/index.html">Zapisy</a></li>
|
||||
<li><a href="drabinka/index.html">Drabinka</a></li>
|
||||
<li id="zapisy"><a href="zapisy/index.html">Zapisy</a></li>
|
||||
<li id="drabinka"><a href="drabinka/index.html">Drabinka</a></li>
|
||||
</ul>
|
||||
</nav>
|
||||
</div>
|
||||
|
@ -96,7 +96,7 @@ async function renderTournaments(organiserTournament) {
|
||||
${tournament.place}
|
||||
${tournament.from} do ${tournament.to}
|
||||
|
||||
<button class="tournamentOpen">OPEN</button>
|
||||
<button class="tournamentOpen">${tournament.rang}</button>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
@ -119,7 +119,8 @@
|
||||
</div>
|
||||
|
||||
|
||||
<button class="cancelButton" type="button" id="cancel" onclick="">Anuluj</button>
|
||||
<button class="cancelButton" type="button" id="cancel"
|
||||
onclick="window.location.href = '../../normal_user/index.html'">Anuluj</button>
|
||||
|
||||
<button class="submitButton" type="submit" id="tournamentsubmit" onclick="createTournament()">
|
||||
Załóż turniej
|
||||
|
Loading…
Reference in New Issue
Block a user