-
- To ja
-
+
-
+
- Hejo
+
diff --git a/frontend/normal_user/_main page/pojedynczy_turniej/zapisy/style.css b/frontend/normal_user/_main page/pojedynczy_turniej/zapisy/style.css
index dc58e78..6ef3ef1 100644
--- a/frontend/normal_user/_main page/pojedynczy_turniej/zapisy/style.css
+++ b/frontend/normal_user/_main page/pojedynczy_turniej/zapisy/style.css
@@ -78,4 +78,11 @@ main {
color: #CF2323;
border: 1px solid black;
+}
+
+.zapisani {
+ width: 100px;
+ height: auto;
+ display: flex;
+ flex-direction: column;
}
\ No newline at end of file
diff --git a/frontend/normal_user/app.js b/frontend/normal_user/app.js
index 3947a24..01be7e1 100644
--- a/frontend/normal_user/app.js
+++ b/frontend/normal_user/app.js
@@ -20,21 +20,45 @@ function checkRoleCreator() {
})
.then(res => res.json())
.then(json => {
- let test = (json['id'])
- renderTournaments(test)
+ let organiser = (json['id'])
+ renderTournaments(organiser)
})
}
-async function renderTournaments(test) {
+function tournamentDelete(id) {
+ event.cancelBubble = true;
+ if (event.stopPropagation) event.stopPropagation();
+ console.log(id)
+ fetch('https://dragonmaster.pl/inz/tournament', {
+ method: "DELETE",
+ headers: {
+ 'Content-type': 'application/json',
+ Authorization: ("Bearer " + localStorage.getItem("token"))
+ },
+
+ body: JSON.stringify(
+ {
+ "id": id
+ }
+ )
+ }
+ )
+
+ .then(res => res.json())
+ .then(data => console.log(data))
+ .catch(error => console.log(error))
+}
+
+
+async function renderTournaments(organiserTournament) {
let tournaments = await showTournaments();
let html = '';
tournaments.forEach(tournament => {
// console.log(test)
organiser = `${tournament.creator}`;
- console.log(organiser)
// console.log(organiser)
- if (organiser == test) {
+ if (organiser == organiserTournament) {
let htmlSegment = `
@@ -50,9 +74,10 @@ async function renderTournaments(test) {
-
+
+
- `;
+ `
html += htmlSegment;
}
else {
@@ -80,9 +105,6 @@ async function renderTournaments(test) {
container.innerHTML = html;
}
-function checkRoleforDelete() {
-
-}
function logout() {
localStorage.clear();
@@ -134,16 +156,4 @@ function checkRole() {
document.getElementById("creator").style.display = "none";
}
-}
-
-// function creatorVisibility() {
-// if (localStorage.getItem("token") == null) {
-// document.getElementById("creator").style.display = "none";
-// }
-// else if (checkRole()) {
-// document.getElementById("creator").style.display = "none";
-// }
-// else {
-// document.getElementById("creator").style.display = "";
-// }
-// }
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/frontend/normal_user/logowanie/app.js b/frontend/normal_user/logowanie/app.js
index b5d799e..9e38012 100644
--- a/frontend/normal_user/logowanie/app.js
+++ b/frontend/normal_user/logowanie/app.js
@@ -12,7 +12,7 @@ function checkRole() {
window.location.href = '../index.html'
}
else {
- window.location.href = '../../panel_organizatora/dodawanie turnieju/index.html'
+ window.location.href = '../index.html'
}
})
diff --git a/frontend/panel_organizatora/dodawanie turnieju/app.js b/frontend/panel_organizatora/dodawanie turnieju/app.js
index 3beb17d..4db1cb4 100644
--- a/frontend/panel_organizatora/dodawanie turnieju/app.js
+++ b/frontend/panel_organizatora/dodawanie turnieju/app.js
@@ -41,18 +41,18 @@ function createTournament() {
"typeOfLadder": "string",
"pointsForTournament": "1",
"places": "1",
- "roles": document.getElementById("category").value,
+ "roles": "role",
"ranked": document.getElementById("rank").value,
"place": document.getElementById("place").value,
- "from": "2020-10-10 10:10:10",
- "to": "2020-10-10 10:10:10",
- "rang": "rang1",
+ "from": document.getElementById("term_from").value,
+ "to": document.getElementById("term_to").value,
+ "rang": document.getElementById("rank").value,
"entryFee": document.getElementById("entry-fee").value,
"director": document.getElementById("director").value,
"phone": document.getElementById("phone").value,
- "entriesTo": "2020-10-10 10:10:10",
+ "entriesTo": document.getElementById("entries").value,
"additionalInformations": document.getElementById("add-info").value,
- "categotry": "cat1",
+ "categotry": document.getElementById("category").value,
"visibility": "TRUE"
}
)
diff --git a/frontend/panel_organizatora/dodawanie turnieju/index.html b/frontend/panel_organizatora/dodawanie turnieju/index.html
index 008ed4e..ae6a491 100644
--- a/frontend/panel_organizatora/dodawanie turnieju/index.html
+++ b/frontend/panel_organizatora/dodawanie turnieju/index.html
@@ -1,6 +1,6 @@
+ xmlns="http://www.w3.org/1999/html">
@@ -9,20 +9,20 @@
Padel Tournaments System
-
+
+ alt="Logo error">
-
+
diff --git a/frontend/panel_organizatora/edycja turnieju/app.js b/frontend/panel_organizatora/edycja turnieju/app.js
index 3beb17d..db8a326 100644
--- a/frontend/panel_organizatora/edycja turnieju/app.js
+++ b/frontend/panel_organizatora/edycja turnieju/app.js
@@ -30,29 +30,28 @@
function createTournament() {
fetch('https://dragonmaster.pl/inz/tournament', {
- method: "PUT",
+ method: "POST",
headers: {
'Content-type': 'application/json',
Authorization: ("Bearer " + localStorage.getItem("token"))
},
body: JSON.stringify(
{
+ "id": localStorage.getItem('tournamentId'),
"name": document.getElementById("name").value,
"typeOfLadder": "string",
"pointsForTournament": "1",
- "places": "1",
+ "places": document.getElementById("place").value,
"roles": document.getElementById("category").value,
- "ranked": document.getElementById("rank").value,
- "place": document.getElementById("place").value,
- "from": "2020-10-10 10:10:10",
- "to": "2020-10-10 10:10:10",
- "rang": "rang1",
+ "from": document.getElementById("term_from").value,
+ "to": document.getElementById("term_to").value,
+ "rang": document.getElementById("rank").value,
"entryFee": document.getElementById("entry-fee").value,
"director": document.getElementById("director").value,
"phone": document.getElementById("phone").value,
- "entriesTo": "2020-10-10 10:10:10",
+ "entriesTo": document.getElementById("entries").value,
"additionalInformations": document.getElementById("add-info").value,
- "categotry": "cat1",
+ "categotry": document.getElementById("category").value,
"visibility": "TRUE"
}
)
@@ -64,6 +63,7 @@ function createTournament() {
.catch(error => console.log(error))
}
+
function logout() {
localStorage.clear();
location.reload();