From b5a7c8c3c5f2541632e67a98bb654f11df5f1a3f Mon Sep 17 00:00:00 2001 From: Arek Date: Fri, 10 Jun 2022 15:33:05 +0200 Subject: [PATCH] fix: --- frontend/_main page/pojedynczy_turniej/app.js | 11 +++++++++++ frontend/app.js | 12 +++++++++++- frontend/index.html | 4 +++- .../panel_organizatora/dodawanie turnieju/app.js | 11 ++++------- .../panel_organizatora/dodawanie turnieju/index.html | 2 +- 5 files changed, 30 insertions(+), 10 deletions(-) create mode 100644 frontend/_main page/pojedynczy_turniej/app.js diff --git a/frontend/_main page/pojedynczy_turniej/app.js b/frontend/_main page/pojedynczy_turniej/app.js new file mode 100644 index 0000000..ea49991 --- /dev/null +++ b/frontend/_main page/pojedynczy_turniej/app.js @@ -0,0 +1,11 @@ +function showTournaments() { + let url = 'https://dragonmaster.pl/inz/tournaments'; + try { + let res = await fetch(url); + return await res.json(); + } catch (error) { + console.log(error); + } + let tournaments = await showTournaments(); + console.log(tournaments[1]) +} \ No newline at end of file diff --git a/frontend/app.js b/frontend/app.js index ccaede2..a119263 100644 --- a/frontend/app.js +++ b/frontend/app.js @@ -11,7 +11,7 @@ async function showTournaments() { async function renderTournaments() { let tournaments = await showTournaments(); let html = ''; - console.log(tournaments) + console.log(tournaments[1]) tournaments.forEach(tournament => { let htmlSegment = `
@@ -58,5 +58,15 @@ function loginVisibility() { else { document.getElementById("login").style.display = ""; + } +} + +function createVisibility() { + if (localStorage.getItem("token") !== null) { + document.getElementById("creator").style.display = "none"; + } + else { + document.getElementById("creator").style.display = ""; + } } \ No newline at end of file diff --git a/frontend/index.html b/frontend/index.html index cf2a5ea..5b8e4c7 100644 --- a/frontend/index.html +++ b/frontend/index.html @@ -10,7 +10,7 @@ - +
diff --git a/frontend/panel_organizatora/dodawanie turnieju/app.js b/frontend/panel_organizatora/dodawanie turnieju/app.js index 672d97a..3beb17d 100644 --- a/frontend/panel_organizatora/dodawanie turnieju/app.js +++ b/frontend/panel_organizatora/dodawanie turnieju/app.js @@ -44,18 +44,16 @@ function createTournament() { "roles": document.getElementById("category").value, "ranked": document.getElementById("rank").value, "place": document.getElementById("place").value, - "from": "string", - "to": "string", + "from": "2020-10-10 10:10:10", + "to": "2020-10-10 10:10:10", "rang": "rang1", "entryFee": document.getElementById("entry-fee").value, "director": document.getElementById("director").value, "phone": document.getElementById("phone").value, - "entriesTo": "string", + "entriesTo": "2020-10-10 10:10:10", "additionalInformations": document.getElementById("add-info").value, "categotry": "cat1", "visibility": "TRUE" - - } ) } @@ -82,7 +80,6 @@ function logoutVisibility() { } - function loginVisibility() { if (localStorage.getItem("token") !== null) { document.getElementById("login").style.display = "none"; @@ -91,4 +88,4 @@ function loginVisibility() { document.getElementById("login").style.display = ""; } -} \ No newline at end of file +} diff --git a/frontend/panel_organizatora/dodawanie turnieju/index.html b/frontend/panel_organizatora/dodawanie turnieju/index.html index b9a3072..b160b9f 100644 --- a/frontend/panel_organizatora/dodawanie turnieju/index.html +++ b/frontend/panel_organizatora/dodawanie turnieju/index.html @@ -7,10 +7,10 @@ Padel Tournaments System + -