Refactor all file using prettier

This commit is contained in:
2024-10-27 11:37:18 +01:00
parent 1c3ec4a1bb
commit b6df2ae362
16 changed files with 1762 additions and 571 deletions

89
.gitignore vendored Normal file
View File

@@ -0,0 +1,89 @@
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
# User-specific stuff
.idea/**/workspace.xml
.idea/**/tasks.xml
.idea/**/usage.statistics.xml
.idea/**/dictionaries
.idea/**/shelf
# AWS User-specific
.idea/**/aws.xml
# Generated files
.idea/**/contentModel.xml
# Sensitive or high-churn files
.idea/**/dataSources/
.idea/**/dataSources.ids
.idea/**/dataSources.local.xml
.idea/**/sqlDataSources.xml
.idea/**/dynamic.xml
.idea/**/uiDesigner.xml
.idea/**/dbnavigator.xml
# Gradle
.idea/**/gradle.xml
.idea/**/libraries
# Gradle and Maven with auto-import
# When using Gradle or Maven with auto-import, you should exclude module files,
# since they will be recreated, and may cause churn. Uncomment if using
# auto-import.
# .idea/artifacts
# .idea/compiler.xml
# .idea/jarRepositories.xml
# .idea/modules.xml
# .idea/*.iml
# .idea/modules
# *.iml
# *.ipr
# CMake
cmake-build-*/
# Mongo Explorer plugin
.idea/**/mongoSettings.xml
# File-based project format
*.iws
# IntelliJ
out/
# mpeltonen/sbt-idea plugin
.idea_modules/
# JIRA plugin
atlassian-ide-plugin.xml
# Cursive Clojure plugin
.idea/replstate.xml
# Crashlytics plugin (for Android Studio and IntelliJ)
com_crashlytics_export_strings.xml
crashlytics.properties
crashlytics-build.properties
fabric.properties
# Editor-based Rest Client
.idea/httpRequests
# Android studio 3.1+ serialized cache file
.idea/caches/build_file_checksums.ser
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
*.code-workspace
# Local History for Visual Studio Code
.history/
# End of https://mrkandreev.name/snippets/gitignore-generator/#WebStorm+all,VisualStudioCode,js,html,css

View File

@@ -5,77 +5,86 @@
<title> Arbitrage Match </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!--- Ajout d'un fichier css pour les classes personalisé --->
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style.css"/>
<script src="js/cookie.js" defer></script>
<link rel="icon" href="assets/appen.png">
<script src="js/backend/login.js" type="module" defer></script>
<script src="js/backend/arbitrage.js" type="module" defer></script>
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30" class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30"
class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" aria-current="page" href="index.html">
<!--
<span class="material-symbols-outlined pe-3">wifi_tethering</span>
--->
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<!---<span class="material-symbols-outlined pe-3">trophy</span>--->
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<!---<span class="material-symbols-outlined pe-3">fitness_center</span>--->
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" role="button" id="disconect">
<!---<span class="material-symbols-outlined">login</span>--->
<div class="pe-3 icons-display"></div>
Déconnexion
</a>
</li>
</ul>
</div>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" aria-current="page" href="index.html">
<!--
<span class="material-symbols-outlined pe-3">wifi_tethering</span>
--->
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<!---<span class="material-symbols-outlined pe-3">trophy</span>--->
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<!---<span class="material-symbols-outlined pe-3">fitness_center</span>--->
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" role="button" id="disconect">
<!---<span class="material-symbols-outlined">login</span>--->
<div class="pe-3 icons-display"></div>
Déconnexion
</a>
</li>
</ul>
</div>
</nav>
</header>
<div class="container">
<div class="col-8 offset-2 mt-6" id="arbitrage">
<div class="text-center"><a href="" class="btn btn-primary" id="btnPoint1">But pour promo X</a></div>
<h5 class="text-center" id="textPoint1"></h5>
<br>
<h5 class="text-center" id="textPoint2"></h5>
<div class="text-center"><a href="" class="btn btn-primary" id="btnPoint2">But pour promo Y</a></div>
<br>
<form id="stopMatch"><div class="text-center"><button type="submit" class="btn btn-danger" id="btnStop">Arrêter le match</button></div></form>
</div>
</nav>
</header>
<div class="container">
<div class="col-8 offset-2 mt-6" id="arbitrage">
<div class="text-center"><a href="" class="btn btn-primary" id="btnPoint1">But pour promo X</a></div>
<h5 class="text-center" id="textPoint1"></h5>
<br>
<h5 class="text-center" id="textPoint2"></h5>
<div class="text-center"><a href="" class="btn btn-primary" id="btnPoint2">But pour promo Y</a></div>
<br>
<form id="stopMatch">
<div class="text-center">
<button type="submit" class="btn btn-danger" id="btnStop">Arrêter le match</button>
</div>
</form>
</div>
</div>
</body>
</html>

View File

@@ -1,105 +1,120 @@
<!DOCTYPE html>
<html lang="fr" data-bs-theme="dark">
<head>
<head>
<meta charset="utf-8">
<title> Arbitrage </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!--- Ajout d'un fichier css pour les classes personalisé --->
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style.css"/>
<script src="js/cookie.js" defer></script>
<link rel="icon" href="assets/appen.png">
<script src="js/backend/login.js" type="module" defer></script>
<script src="js/backend/match.js" type="module" defer></script>
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30" class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30"
class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" aria-current="page" href="index.html">
<!--
<span class="material-symbols-outlined pe-3">wifi_tethering</span>
--->
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<!---<span class="material-symbols-outlined pe-3">trophy</span>--->
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<!---<span class="material-symbols-outlined pe-3">fitness_center</span>--->
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" role="button" id="disconect">
<!---<span class="material-symbols-outlined">login</span>--->
<div class="pe-3 icons-display"></div>
Déconnexion
</a>
</li>
</ul>
</div>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" aria-current="page" href="index.html">
<!--
<span class="material-symbols-outlined pe-3">wifi_tethering</span>
--->
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<!---<span class="material-symbols-outlined pe-3">trophy</span>--->
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<!---<span class="material-symbols-outlined pe-3">fitness_center</span>--->
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" role="button" id="disconect">
<!---<span class="material-symbols-outlined">login</span>--->
<div class="pe-3 icons-display"></div>
Déconnexion
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
</nav>
</header>
<div class="container">
<div class="col-8 offset-2 mt-6" id="cardContainer">
<div class="text-center align-items-center"><button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalAddMatch">Ajouter un match</button></div>
<div class="container">
<div class="col-8 offset-2 mt-6" id="cardContainer">
<div class="text-center align-items-center">
<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#modalAddMatch">Ajouter
un match
</button>
</div>
<br>
<div class="text-center align-items-center"><button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#modalRemoveMatch">Supprimer un match</button></div>
<div class="text-center align-items-center">
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#modalRemoveMatch">
Supprimer un match
</button>
</div>
<div class="modal" tabindex="-1" id="modalAddMatch">
</div>
<div class="modal" tabindex="-2" id="modalRemoveMatch" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Supprimer un match</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Fermer"></button>
</div>
<div class="modal-body">
<form id="delMatchForm">
<div class="mb-3" id="matchdelJS">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Supprimer un match</h5>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Fermer"></button>
</div>
<div class="modal-body">
<form id="delMatchForm">
<div class="mb-3" id="matchdelJS">
</div>
<button type="submit" class="btn btn-danger">Supprimer ce match (attention cette action est irréversible)</button>
</form>
</div>
</div>
<button type="submit" class="btn btn-danger">Supprimer ce match (attention cette action est
irréversible)
</button>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-8 offset-2 mt-6" id="cardContainer2"></div>
</div>
<div class="col-8 offset-2 mt-6" id="cardContainer2"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -1,76 +1,84 @@
<!DOCTYPE html>
<html lang="fr" data-bs-theme="dark">
<head>
<head>
<meta charset="utf-8">
<title> Matchs en direct </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!--- Ajout d'un fichier css pour les classes personalisé --->
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style.css"/>
<script src="js/alerts.js"></script>
<script src="js/cookie.js" defer></script>
<link rel="icon" href="assets/appen.png">
<script src="js/backend/match.js" type="module" defer></script>
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30" class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30"
class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link active d-inline-flex align-items-center" aria-current="page" href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link active d-inline-flex align-items-center" aria-current="page"
href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
</nav>
</header>
<div id="alertsContainer" class="position-fixed container z-3">
<!-- ALERTS HTML WILL APPEAR HERE -->
</div>
<div class="container">
<div class="col-8 offset-2 mt-6" id="cardContainer">
</div>
<div class="col-8 offset-2 mt-6" id="cardContainer2"></div>
<div id="alertsContainer" class="position-fixed container z-3">
<!-- ALERTS HTML WILL APPEAR HERE -->
</div>
<div class="container">
<div class="col-8 offset-2 mt-6" id="cardContainer">
</div>
<div class="col-8 offset-2 mt-6" id="cardContainer2"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -1,5 +1,5 @@
function getSportIconHTML(sportName){
switch(sportName.toLowerCase()){
function getSportIconHTML(sportName) {
switch (sportName.toLowerCase()) {
case "football":
return `<span class="material-symbols-outlined">
sports_soccer
@@ -21,12 +21,12 @@ function getSportIconHTML(sportName){
}
}
function deleteAlert(alertId){
function deleteAlert(alertId) {
const alert = bootstrap.Alert.getOrCreateInstance(`body #alertsContainer #${alertId}`)
alert.close()
}
function newGoalAlert(match, goalTeam){
function newGoalAlert(match, goalTeam) {
let alertsContainer = document.querySelector('body #alertsContainer');
let alert = `
<div id="${match.id}${match.point1}_${match.point2}" class="alert alert-success alert-dismissible fade show" role="alert">
@@ -57,7 +57,7 @@ function newGoalAlert(match, goalTeam){
setTimeout(deleteAlert, 5000, `${match.id}${match.point1}_${match.point2}`)
}
function matchEndAlert(match){
function matchEndAlert(match) {
let alertsContainer = document.querySelector('body #alertsContainer');
let alert = `
<div id="${match.id}${match.point1}_${match.point2}" class="alert alert-warning alert-dismissible fade show" role="alert">
@@ -88,7 +88,7 @@ function matchEndAlert(match){
setTimeout(deleteAlert, 5000, `${match.id}${match.point1}_${match.point2}`)
}
function startMatchAlert(match){
function startMatchAlert(match) {
let alertsContainer = document.querySelector('body #alertsContainer');
let alert = `
<div id="${match.id}${match.point1}_${match.point2}" class="alert alert-info alert-dismissible fade show" role="alert">
@@ -119,7 +119,7 @@ function startMatchAlert(match){
setTimeout(deleteAlert, 5000, `${match.id}${match.point1}_${match.point2}`)
}
function newSetAlert(match){
function newSetAlert(match) {
let alertsContainer = document.querySelector('body #alertsContainer');
let alert = `
<div id="${match.id}${match.set1}_${match.set2}" class="alert alert-info alert-dismissible fade show" role="alert">

View File

@@ -35,7 +35,7 @@ const buttonPoint1 = document.getElementById("btnPoint1")
const buttonPoint2 = document.getElementById("btnPoint2")
//Gestion du cas basketball
if(currentStatus.expand.sport.name === "basketball"){
if (currentStatus.expand.sport.name === "basketball") {
//Suppression des boutons de points
document.getElementById("arbitrage").innerHTML = "";
const arbitrageDiv = document.getElementById("arbitrage");
@@ -115,7 +115,7 @@ if(currentStatus.expand.sport.name === "basketball"){
const point3Team2 = document.getElementById("btnPoint2Btn3");
//Gestion des points
point1Team1.addEventListener('click', async function(event) {
point1Team1.addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
@@ -132,7 +132,7 @@ if(currentStatus.expand.sport.name === "basketball"){
});
//Même chose pour les autres boutons
point2Team1.addEventListener('click', async function(event) {
point2Team1.addEventListener('click', async function (event) {
event.preventDefault();
const data = {
"point1": currentStatus.point1 + 2,
@@ -143,7 +143,7 @@ if(currentStatus.expand.sport.name === "basketball"){
});
//Même chose pour les autres boutons
point3Team1.addEventListener('click', async function(event) {
point3Team1.addEventListener('click', async function (event) {
event.preventDefault();
const data = {
"point1": currentStatus.point1 + 3,
@@ -154,7 +154,7 @@ if(currentStatus.expand.sport.name === "basketball"){
});
//Même chose pour les autres boutons
point1Team2.addEventListener('click', async function(event) {
point1Team2.addEventListener('click', async function (event) {
event.preventDefault();
const data = {
"point2": currentStatus.point2 + 1,
@@ -165,7 +165,7 @@ if(currentStatus.expand.sport.name === "basketball"){
});
//Même chose pour les autres boutons
point2Team2.addEventListener('click', async function(event) {
point2Team2.addEventListener('click', async function (event) {
event.preventDefault();
const data = {
"point2": currentStatus.point2 + 2,
@@ -176,7 +176,7 @@ if(currentStatus.expand.sport.name === "basketball"){
});
//Même chose pour les autres boutons
point3Team2.addEventListener('click', async function(event) {
point3Team2.addEventListener('click', async function (event) {
event.preventDefault();
const data = {
"point2": currentStatus.point2 + 3,
@@ -185,14 +185,13 @@ if(currentStatus.expand.sport.name === "basketball"){
textPoint2.innerHTML = currentStatus.point2 + 3;
location.reload();
});
}
else if(currentStatus.expand.sport.name === "volleyball" || currentStatus.expand.sport.name === "badminton"){
} else if (currentStatus.expand.sport.name === "volleyball" || currentStatus.expand.sport.name === "badminton") {
//Mise à jour de l'affichage des boutons
buttonPoint1.innerHTML = "1 point pour " + currentStatus.expand.team1.name;
buttonPoint2.innerHTML = "1 point pour " + currentStatus.expand.team2.name;
//Comptage des points
buttonPoint1.addEventListener('click', async function(event) {
buttonPoint1.addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
@@ -209,7 +208,7 @@ else if(currentStatus.expand.sport.name === "volleyball" || currentStatus.expand
});
//Même chose pour l'autre bouton
buttonPoint2.addEventListener('click', async function(event) {
buttonPoint2.addEventListener('click', async function (event) {
event.preventDefault();
const data = {
"point2": currentStatus.point2 + 1,
@@ -241,15 +240,13 @@ else if(currentStatus.expand.sport.name === "volleyball" || currentStatus.expand
pointTeam2.innerHTML = currentStatus.point2 + " (" + currentStatus.set2 + ")";
const set1Team1 = document.getElementById("btnSet1");
const set1Team2 = document.getElementById("btnSet2");
set1Team1.addEventListener('click', async function(event) {
set1Team1.addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
//Mise à jour du nombre de points
const data = {
"set1": currentStatus.set1 + 1,
"point1": 0,
"point2": 0,
"set1": currentStatus.set1 + 1, "point1": 0, "point2": 0,
};
//Envoi de la requête
const record = await pb.collection('match').update(idMatch, data);
@@ -259,15 +256,13 @@ else if(currentStatus.expand.sport.name === "volleyball" || currentStatus.expand
//Rechargement de la page pour mettre à jour les données
location.reload();
});
set1Team2.addEventListener('click', async function(event) {
set1Team2.addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
//Mise à jour du nombre de points
const data = {
"set2": currentStatus.set2 + 1,
"point1": 0,
"point2": 0,
"set2": currentStatus.set2 + 1, "point1": 0, "point2": 0,
};
//Envoi de la requête
const record = await pb.collection('match').update(idMatch, data);
@@ -279,13 +274,13 @@ else if(currentStatus.expand.sport.name === "volleyball" || currentStatus.expand
});
}
//Gestion des autres sports
else{
else {
//Mise à jour de l'affichage des boutons
buttonPoint1.innerHTML = "1 point pour " + currentStatus.expand.team1.name;
buttonPoint2.innerHTML = "1 point pour " + currentStatus.expand.team2.name;
//Comptage des points
buttonPoint1.addEventListener('click', async function(event) {
buttonPoint1.addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
@@ -302,7 +297,7 @@ else{
});
//Même chose pour l'autre bouton
buttonPoint2.addEventListener('click', async function(event) {
buttonPoint2.addEventListener('click', async function (event) {
event.preventDefault();
const data = {
"point2": currentStatus.point2 + 1,
@@ -314,7 +309,7 @@ else{
}
//Gestion de l'arrêt du match
document.getElementById("btnStop").addEventListener('click', async function(event) {
document.getElementById("btnStop").addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
//Mise à jour du statut du match
@@ -323,36 +318,36 @@ document.getElementById("btnStop").addEventListener('click', async function(even
};
//Envoi de la requête
const record = await pb.collection('match').update(idMatch, data);
if(currentStatus.mode == "poules"){
if (currentStatus.mode == "poules") {
//Ajout des points victoire ou égalité
if(currentStatus.point1 === currentStatus.point2){
if (currentStatus.point1 === currentStatus.point2) {
await addPoints(currentStatus.team1, 1)
await addPoints(currentStatus.team2, 1)
} else if(currentStatus.point1 > currentStatus.point2) {
} else if (currentStatus.point1 > currentStatus.point2) {
await addPoints(currentStatus.team1, 3)
} else if(currentStatus.point1 < currentStatus.point2) {
} else if (currentStatus.point1 < currentStatus.point2) {
await addPoints(currentStatus.team2, 3)
}
//Calcul du classement de chaque équipe
await setTeamClassement(currentStatus.sport)
} else if(currentStatus.mode === "tournoi") {
if(currentStatus.point1 > currentStatus.point2) {
} else if (currentStatus.mode === "tournoi") {
if (currentStatus.point1 > currentStatus.point2) {
await eliminateTeam(currentStatus.team2)
await promoteNextStade(currentStatus.team1)
} else if(currentStatus.point1 < currentStatus.point2) {
} else if (currentStatus.point1 < currentStatus.point2) {
await eliminateTeam(currentStatus.team1)
await promoteNextStade(currentStatus.team2)
}
}
//Redirection vers la page d'arbitrage
window.location.href = "arbitrage.html";
});
async function addPoints(teamId, points){
async function addPoints(teamId, points) {
const equipe = EquipeList.find(equipe => equipe.id === teamId)
if(equipe){
if (equipe) {
const data = {
"points": equipe.points + points,
};
@@ -360,76 +355,76 @@ async function addPoints(teamId, points){
}
}
async function setTeamClassement(sportId){
async function setTeamClassement(sportId) {
let sportTeams = []
const equipesList = await pb.collection('equipes').getFullList({expand: 'sport',})
equipesList.forEach(equipe => {
if(equipe.expand.sport.id === sportId){
if (equipe.expand.sport.id === sportId) {
sportTeams.push(equipe)//On sélectionne toutes les équipes du sport indiqué en paramètres
}
})
sportTeams.sort((teamA, teamB) => {
let diff = parseInt(teamB.points, 10) - parseInt(teamA.points, 10)
if(diff !== 0){
if (diff !== 0) {
return diff;
} else {
return goalsDiff(teamA, teamB);
}
})//On range les équipes par ordre de points décroissant
for(let i = 1; i <= sportTeams.length; i++){
for (let i = 1; i <= sportTeams.length; i++) {
const data = {
"classement": i,
};
const record = await pb.collection("equipes").update(sportTeams[i-1].id, data);
const record = await pb.collection("equipes").update(sportTeams[i - 1].id, data);
}
}
async function eliminateTeam(teamId){
async function eliminateTeam(teamId) {
const data = {
"eliminated": true,
};
const record = await pb.collection("equipes").update(teamId, data);
}
async function promoteNextStade(teamId){
async function promoteNextStade(teamId) {
let equipe = EquipeList.find(equipe => equipe.id === teamId)
if(equipe){
if(equipe.stade !== '1'){
if (equipe) {
if (equipe.stade !== '1') {
const data = {
"stade": (parseInt(equipe.stade, 10)/2).toString(),
"stade": (parseInt(equipe.stade, 10) / 2).toString(),
};
const record = await pb.collection("equipes").update(equipe.id, data);
}
}
}
function goalsDiff(teamA, teamB){
function goalsDiff(teamA, teamB) {
let totalA = 0
let totalB = 0
MatchList.forEach(match => {
if(match.team1 === teamA.id){
if(match.point1 > match.point2){
if (match.team1 === teamA.id) {
if (match.point1 > match.point2) {
totalA += match.point1 - match.point2
} else {
totalA += match.point2 - match.point1
}
}
if(match.team2 === teamA.id){
if(match.point1 < match.point2){
if (match.team2 === teamA.id) {
if (match.point1 < match.point2) {
totalA += match.point2 - match.point1
} else {
totalA += match.point1 - match.point2
}
}
if(match.team1 === teamB.id){
if(match.point1 > match.point2){
if (match.team1 === teamB.id) {
if (match.point1 > match.point2) {
totalB += match.point1 - match.point2
} else {
totalB += match.point2 - match.point1
}
}
if(match.team2 === teamB.id){
if(match.point1 < match.point2){
if (match.team2 === teamB.id) {
if (match.point1 < match.point2) {
totalB += match.point2 - match.point1
} else {
totalB += match.point1 - match.point2

View File

@@ -4,10 +4,10 @@ import PocketBase from '../pocketbase.es.mjs'
const pb = new PocketBase("https://pocketbase.appen.fr");
//Connexion
if(window.location.href.includes("login.html")){
if (window.location.href.includes("login.html")) {
const loginButton = document.querySelector('button[type="submit"]');
loginButton.addEventListener('click', async function(event) {
loginButton.addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
@@ -34,15 +34,15 @@ if(window.location.href.includes("login.html")){
}
//Redirection vers la page d'arbitrage si l'utilisateur est déjà connecté
if(window.location.href.includes("login.html")){
if(pb.authStore.isValid === true){
if (window.location.href.includes("login.html")) {
if (pb.authStore.isValid === true) {
window.location.href = "arbitrage.html";
}
}
//Redirection vers la page de login si l'utilisateur n'est pas connecté
if(window.location.href.includes("arbitrage.html") || window.location.href.includes("arbimatch.html")){
if(pb.authStore.isValid === false){
if (window.location.href.includes("arbitrage.html") || window.location.href.includes("arbimatch.html")) {
if (pb.authStore.isValid === false) {
window.location.href = "login.html";
}
}
@@ -51,7 +51,7 @@ if(window.location.href.includes("arbitrage.html") || window.location.href.inclu
//Déconnexion
if (pb.authStore.isValid && window.location.href.includes("arbitrage.html") || window.location.href.includes("arbimatch.html")) {
const logoutButton = document.getElementById('disconect');
logoutButton.addEventListener('click', async function(event) {
logoutButton.addEventListener('click', async function (event) {
//Annulation du comportement par défaut
event.preventDefault();
//Déconnexion

View File

@@ -9,10 +9,9 @@ let matchList = await pb.collection('match').getFullList({
//Check if navigator supports notifications
if (!("Notification" in window)) {
console.error("Ce navigateur ne supporte pas les notifications desktop");
}
else{
} else {
//Ask for notifications permission on page load
window.addEventListener('load', function() {
window.addEventListener('load', function () {
if (Notification.permission !== "granted") {
Notification.requestPermission();
}
@@ -26,7 +25,7 @@ const sportList = await pb.collection('sport').getFullList({});
//Gestion des mises à jour en temps réel des matchs
matchList.forEach(match => {
//Si le match est en cours
if(match.status === "in_progress" || match.status === "waiting"){
if (match.status === "in_progress" || match.status === "waiting") {
//Abonnement au match
pb.collection('match').subscribe(match.id, async function (e) {
//Si le match a été mis à jour
@@ -48,7 +47,7 @@ matchList.forEach(match => {
match.point2 = e.record.point2
newGoalAlert(match, "team2")
}
if(e.record.status === "in_progress"){
if (e.record.status === "in_progress") {
document.getElementById("cardHeader" + match.id).classList.remove("text-primary-emphasis");
document.getElementById("cardHeader" + match.id).classList.add("text-warning-emphasis");
document.getElementById("cardFooter" + match.id).classList.remove("text-primary-emphasis");
@@ -65,7 +64,7 @@ matchList.forEach(match => {
const cardHeaderPointT2 = document.createElement('p');
cardHeaderPointT2.id = "pointT2" + match.id;
cardHeaderPointT2.innerText = match.point2;
if(match.expand.sport.name === "badminton" || match.expand.sport.name === "volleyball"){
if (match.expand.sport.name === "badminton" || match.expand.sport.name === "volleyball") {
cardHeaderPointT1.innerText = match.point1 + ' (' + match.set1 + ')';
cardHeaderPointT2.innerText = match.point2 + ' (' + match.set2 + ')';
}
@@ -73,7 +72,7 @@ matchList.forEach(match => {
cardHeaderPointDiv.appendChild(cardHeaderSeparator);
cardHeaderPointDiv.appendChild(cardHeaderPointT2);
document.getElementById("cardHeader" + match.id).appendChild(cardHeaderPointDiv);
if(e.record.point1 === 0 && e.record.point2 === 0){
if (e.record.point1 === 0 && e.record.point2 === 0) {
startMatchAlert(match);
}
}
@@ -91,7 +90,7 @@ matchList.forEach(match => {
container.appendChild(card);
matchEndAlert(match);
}
if(e.record.set1 !== match.set1 || e.record.set2 !== match.set2){
if (e.record.set1 !== match.set1 || e.record.set2 !== match.set2) {
newSetAlert(match);
}
}
@@ -100,7 +99,7 @@ matchList.forEach(match => {
});
//Affichage des matchs sur la page d'arbitrage
if(window.location.href.includes("arbitrage.html")){
if (window.location.href.includes("arbitrage.html")) {
//Affichage des matchs
matchList.forEach(record => {
let container = document.getElementById('cardContainer');
@@ -116,7 +115,7 @@ if(window.location.href.includes("arbitrage.html")){
//Affichage du nom des équipes
const cardTitle = document.createElement('h5');
cardTitle.className = "card-title text-center";
if(record.team1 && record.team2){
if (record.team1 && record.team2) {
cardTitle.innerText = record.expand.team1.name + " VS " + record.expand.team2.name;
}
//Affichage du sport
@@ -131,35 +130,32 @@ if(window.location.href.includes("arbitrage.html")){
arbitrageButton.className = "text-center";
const arbitrageButtonLink = document.createElement('a');
//Gestion des couleurs du bouton en fonction du statut du match
if(record.status === "waiting") {
if (record.status === "waiting") {
arbitrageButtonLink.className = "btn btn-primary mt-2";
arbitrageButtonLink.innerHTML = "Démarrer et arbitrer ce match";
}
else if(record.status === "in_progress") {
} else if (record.status === "in_progress") {
arbitrageButtonLink.className = "btn btn-warning mt-2";
arbitrageButtonLink.innerHTML = "Arbitrer ce match";
}
else if(record.status === "finished") {
} else if (record.status === "finished") {
arbitrageButtonLink.className = "btn btn-success mt-2";
arbitrageButtonLink.innerHTML = "Match terminé";
container = document.getElementById('cardContainer2');
}
else{
} else {
arbitrageButtonLink.className = "btn btn-secondary mt-2";
arbitrageButtonLink.innerHTML = "Erreur de statut";
}
//Gestion du lien du bouton
arbitrageButtonLink.addEventListener('click', async function(event) {
arbitrageButtonLink.addEventListener('click', async function (event) {
window.location.href = "arbimatch.html?id=" + record.id;
});
//Ajout des éléments à la carte
arbitrageButton.appendChild(arbitrageButtonLink);
card.appendChild(cardHeader);
if(record.team1 && record.team2){
if (record.team1 && record.team2) {
cardBody.appendChild(cardTitle);
}
cardBody.appendChild(cardText);
if(record.name !== ""){
if (record.name !== "") {
cardBody.appendChild(cardDescr);
}
cardBody.appendChild(arbitrageButton);
@@ -170,7 +166,7 @@ if(window.location.href.includes("arbitrage.html")){
}
//Gestion des informations dans la modal
if(window.location.href.includes("arbitrage.html")){
if (window.location.href.includes("arbitrage.html")) {
//Création de la modal
const modal = document.getElementById('modalAddMatch');
const modalDialog = document.createElement('div');
@@ -288,9 +284,9 @@ if(window.location.href.includes("arbitrage.html")){
//Gestion de l'ajout d'un match
if(window.location.href.includes("arbitrage.html")){
if (window.location.href.includes("arbitrage.html")) {
const addMatchForm = document.getElementById('addMatchForm');
addMatchForm.addEventListener('submit', async function(event) {
addMatchForm.addEventListener('submit', async function (event) {
//Empêche le rechargement de la page
event.preventDefault();
@@ -310,10 +306,9 @@ if(window.location.href.includes("arbitrage.html")){
//Décalage de l'heure de début de 1h pour la gestion du fuseau horaire
time_start.setHours(time_start.getHours() - 1);
let currentMode = "";
if(sportID.name === "badminton"){
if (sportID.name === "badminton") {
currentMode = "tournoi";
}
else{
} else {
currentMode = "poules"
}
const data = {
@@ -342,7 +337,7 @@ if(window.location.href.includes("arbitrage.html")){
const association = [];
//Gestion de la modal de supression d'un match
if(window.location.href.includes("arbitrage.html")){
if (window.location.href.includes("arbitrage.html")) {
//Création de la modal
const delMatchDiv = document.getElementById('matchdelJS');
const delMatchLabel = document.createElement('label');
@@ -357,7 +352,7 @@ if(window.location.href.includes("arbitrage.html")){
const delMatchOption = document.createElement('option');
let time_start = new Date(record.heure_debut);
if(record.team1 && record.team2){
if (record.team1 && record.team2) {
delMatchOption.innerHTML = record.expand.team1.name + " VS " + record.expand.team2.name + " - " + record.expand.sport.name + " - " + time_start.toLocaleString();
} else {
delMatchOption.innerHTML = record.name + ' - ' + record.expand.sport.name + " - " + time_start.toLocaleString();
@@ -378,10 +373,10 @@ if(window.location.href.includes("arbitrage.html")){
}
//Gestion de la supression d'un match
if(window.location.href.includes("arbitrage.html")){
if (window.location.href.includes("arbitrage.html")) {
//Récupération du formulaire
const delMatchForm = document.getElementById('delMatchForm');
delMatchForm.addEventListener('submit', async function(event) {
delMatchForm.addEventListener('submit', async function (event) {
//Empêche le rechargement de la page
event.preventDefault();
@@ -403,7 +398,7 @@ if(window.location.href.includes("arbitrage.html")){
//Affichage des matchs sur la page d'accueil
//Elle s'appele indox.html ou bien n'as pas d'autre juste /
if(window.location.href.includes("index.html") || window.location.href === "https://interpromo.appen.fr/"){
if (window.location.href.includes("index.html") || window.location.href === "https://interpromo.appen.fr/") {
//Affichage des matchs
matchList.forEach(match => {
let container = document.getElementById('cardContainer');
@@ -414,23 +409,20 @@ if(window.location.href.includes("index.html") || window.location.href === "http
const cardHeader = document.createElement('div');
cardHeader.className = "card-header text-center bg-light-subtle ";
cardHeader.id = "cardHeader" + match.id;
if(match.status === "waiting") {
if (match.status === "waiting") {
cardHeader.classList.add("text-primary-emphasis");
}
else if(match.status === "in_progress") {
} else if (match.status === "in_progress") {
cardHeader.classList.add("text-warning-emphasis");
}
else if(match.status === "finished") {
} else if (match.status === "finished") {
cardHeader.classList.add("text-success-emphasis");
}
else{
} else {
cardHeader.classList.add("text-emphasis-light");
}
//Affichage de l'heure de début si le match n'est pas en cours ou a une erreur de statut
const time_start = new Date(match.heure_debut);
cardHeader.innerText = time_start.toLocaleString();
//Affichage des points si le match est en cours ou terminé
if(match.status === "in_progress"){
if (match.status === "in_progress") {
cardHeader.innerText = "";
const cardHeaderPointDiv = document.createElement('div');
cardHeaderPointDiv.className = "d-flex justify-content-evenly";
@@ -442,7 +434,7 @@ if(window.location.href.includes("index.html") || window.location.href === "http
const cardHeaderPointT2 = document.createElement('p');
cardHeaderPointT2.id = "pointT2" + match.id;
cardHeaderPointT2.innerText = match.point2;
if(match.expand.sport.name === "badminton" || match.expand.sport.name === "volleyball"){
if (match.expand.sport.name === "badminton" || match.expand.sport.name === "volleyball") {
cardHeaderPointT1.innerText = match.point1 + ' (' + match.set1 + ')';
cardHeaderPointT2.innerText = match.point2 + ' (' + match.set2 + ')';
}
@@ -451,7 +443,7 @@ if(window.location.href.includes("index.html") || window.location.href === "http
cardHeaderPointDiv.appendChild(cardHeaderPointT2);
cardHeader.appendChild(cardHeaderPointDiv);
}
if(match.status === "finished"){
if (match.status === "finished") {
container = document.getElementById('cardContainer2');
cardHeader.innerText = "";
const cardHeaderPointDiv = document.createElement('div');
@@ -464,7 +456,7 @@ if(window.location.href.includes("index.html") || window.location.href === "http
const cardHeaderPointT2 = document.createElement('p');
cardHeaderPointT2.id = "pointT2" + match.id;
cardHeaderPointT2.innerText = match.point2;
if(match.expand.sport.name === "badminton" || match.expand.sport.name === "volleyball"){
if (match.expand.sport.name === "badminton" || match.expand.sport.name === "volleyball") {
cardHeaderPointT1.innerText = match.point1 + ' (' + match.set1 + ')';
cardHeaderPointT2.innerText = match.point2 + ' (' + match.set2 + ')';
}
@@ -478,7 +470,7 @@ if(window.location.href.includes("index.html") || window.location.href === "http
//Affichage du nom des équipes
const cardTitle = document.createElement('h5');
cardTitle.className = "card-title text-center";
if(match.team1 && match.team2){
if (match.team1 && match.team2) {
cardTitle.innerText = match.expand.team1.name + " VS " + match.expand.team2.name;
}
//Affichage du sport
@@ -490,33 +482,30 @@ if(window.location.href.includes("index.html") || window.location.href === "http
cardDescr.innerText = match.name;
//Affichage du statut
const cardFooter = document.createElement('div');
if(match.status === "waiting") {
if (match.status === "waiting") {
cardFooter.className = "card-footer bg-light-subtle text-primary-emphasis";
cardFooter.id = "cardFooter" + match.id;
cardFooter.innerHTML = "Match en attente";
}
else if(match.status === "in_progress") {
} else if (match.status === "in_progress") {
cardFooter.className = "card-footer bg-light-subtle text-warning-emphasis";
cardFooter.id = "cardFooter" + match.id;
cardFooter.innerHTML = "Match en cours";
}
else if(match.status === "finished") {
} else if (match.status === "finished") {
cardFooter.className = "card-footer bg-light-subtle text-success-emphasis";
cardFooter.id = "cardFooter" + match.id;
cardFooter.innerHTML = "Match terminé";
}
else{
} else {
cardFooter.className = "card-footer bg-light-subtle text-emphasis-light";
cardFooter.id = "cardFooter" + match.id;
cardFooter.innerHTML = "Erreur de statut";
}
//Ajout des éléments à la carte
card.appendChild(cardHeader);
if(match.team1 && match.team2){
if (match.team1 && match.team2) {
cardBody.appendChild(cardTitle);
}
cardBody.appendChild(cardText);
if(match.name !== ""){
if (match.name !== "") {
cardBody.appendChild(cardDescr);
}
card.appendChild(cardBody);
@@ -527,6 +516,4 @@ if(window.location.href.includes("index.html") || window.location.href === "http
}
console.log("Backend match loaded!");

View File

@@ -12,44 +12,44 @@ const matchList = await pb.collection('match').getFullList({
expand: 'sport,team1,team2',
});
function getOrderedTableTeams(sport){
function getOrderedTableTeams(sport) {
let result = "";
if(sport.tableau !== ""){
if (sport.tableau !== "") {
result += `<h6 class="text-secondary-emphasis fw-semibold">${sport.tableau}</h6>`
}
if(sport.state === "waiting"){
if (sport.state === "waiting") {
result += "<h5>La compétition n'a pas commencé</h5>"
} else if(sport.type === "poules"){
} else if (sport.type === "poules") {
let teams = EquipeList.filter(equipe => equipe.sport === sport.id).sort((teamA, teamB) => teamA.classement - teamB.classement)
let goalAverageText = ""
if(teams[0].points === teams[1].points){
if (teams[0].points === teams[1].points) {
goalAverageText = "(" + teams[0].goalAverage + ")"
}
result += `<h5 class="d-flex justify-content-between align-items-start">${teams[0].name}<span class="badge bg-warning text-black rounded-pill">${teams[0].points} pts${goalAverageText}</span></h5>`
for(let i = 1; i < teams.length; i++){
for (let i = 1; i < teams.length; i++) {
let color = ""
if(teams[i].classement <= sport.qualified){
if (teams[i].classement <= sport.qualified) {
color = "bg-success"
} else {
color = "bg-danger"
}
goalAverageText = ""
if(teams[i].points === teams[i-1].points){
if (teams[i].points === teams[i - 1].points) {
goalAverageText = "(" + teams[i].goalAverage + ")"
}
if(i+1 < teams.length){
if(teams[i].points === teams[i+1].points){
if (i + 1 < teams.length) {
if (teams[i].points === teams[i + 1].points) {
goalAverageText = "(" + teams[i].goalAverage + ")"
}
}
result += `<div class="d-flex justify-content-between align-items-start">${teams[i].classement}e : ${teams[i].name}<span class="badge ${color} rounded-pill">${teams[i].points} pts${goalAverageText}</span></div>`
}
} else if(sport.type === "tournois"){
if(sport.state === "started"){
} else if (sport.type === "tournois") {
if (sport.state === "started") {
let teams = EquipeList.filter(equipe => equipe.expand.sport.name === sport.name && equipe.stade !== '').sort((teamA, teamB) => parseInt(teamA.stade, 10) - parseInt(teamB.stade, 10))
for(let i = 0; i < teams.length; i++){
for (let i = 0; i < teams.length; i++) {
let stade;
switch(teams[i].stade){
switch (teams[i].stade) {
case "16":
stade = "16èmes"
break;
@@ -67,20 +67,20 @@ function getOrderedTableTeams(sport){
break;
}
let color = ""
if(teams[i].eliminated){
if (teams[i].eliminated) {
color = "bg-danger"
} else {
color = "bg-success"
}
result += `<div class="d-flex justify-content-between align-items-start">${teams[i].name}<span class="badge ${color} rounded-pill">${stade}</span></div>`
}
} else if(sport.state === "finished"){
} else if (sport.state === "finished") {
let teams = EquipeList.filter(equipe => equipe.expand.sport.name === sport.name && equipe.stade !== '').sort((teamA, teamB) => parseInt(teamA.stade, 10) - parseInt(teamB.stade, 10))
for(let i = 0; i < teams.length; i++){
for (let i = 0; i < teams.length; i++) {
let classement;
let color = ""
let textColor = ""
switch(teams[i].stade){
switch (teams[i].stade) {
case "16":
classement = "16èmes"
color = "bg-secondary"
@@ -94,7 +94,7 @@ function getOrderedTableTeams(sport){
color = "bg-secondary"
break;
case "2":
if(teams[i].eliminated){
if (teams[i].eliminated) {
color = "bg-primary-subtle"
classement = "Quatrième"
} else {
@@ -103,7 +103,7 @@ function getOrderedTableTeams(sport){
}
break;
case "1":
if(teams[i].eliminated){
if (teams[i].eliminated) {
color = "bg-success"
classement = "Second"
} else {
@@ -120,21 +120,27 @@ function getOrderedTableTeams(sport){
return result;
}
function getSportNextMatchText(sport){
let match = matchList.find(matche => matche.expand.sport.name === sport&& matche.status === "waiting");
if(!match){
function getSportNextMatchText(sport) {
let match = matchList.find(matche => matche.expand.sport.name === sport && matche.status === "waiting");
if (!match) {
return "Pas de match prévu";
}
const time_start = new Date(match.heure_debut);
if(match.team1 && match.team2){
return "Prochain match : " + match.expand.team1.name + " vs " + match.expand.team2.name + ' ' + time_start.toLocaleString('fr', { weekday: 'long' }) + " à " + time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' });
if (match.team1 && match.team2) {
return "Prochain match : " + match.expand.team1.name + " vs " + match.expand.team2.name + ' ' + time_start.toLocaleString('fr', {weekday: 'long'}) + " à " + time_start.toLocaleString('fr', {
hour: 'numeric',
minute: 'numeric'
});
} else {
return "Prochain match : " + match.name + ' ' + time_start.toLocaleString('fr', { weekday: 'long' }) + " à " + time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' });
return "Prochain match : " + match.name + ' ' + time_start.toLocaleString('fr', {weekday: 'long'}) + " à " + time_start.toLocaleString('fr', {
hour: 'numeric',
minute: 'numeric'
});
}
}
function getSportIcon(sport){
switch(sport) {
function getSportIcon(sport) {
switch (sport) {
case "basketball":
return ` <span class="material-symbols-outlined">sports_basketball</span>`
case "volleyball":
@@ -148,18 +154,18 @@ function getSportIcon(sport){
}
}
function getSportCard(sportName){
function getSportCard(sportName) {
let listeTableau = SportList.filter(sport => sport.name === sportName);
let result = `
let result = `
<div class="card my-3">
<div class="card-header text-center bg-light-subtle text-emphasis-light"><div class="d-flex justify-content-evenly">${getSportIcon(sportName)}${sportName.toUpperCase()}${getSportIcon(sportName)}</div></div>
<div class="card-body bg-light-subtle text-emphasis-light">`
result += getOrderedTableTeams(listeTableau[0])
for(let i = 1; i < listeTableau.length; i++){
result += "<hr>"
result += getOrderedTableTeams(listeTableau[i])
}
result += `</div>
result += getOrderedTableTeams(listeTableau[0])
for (let i = 1; i < listeTableau.length; i++) {
result += "<hr>"
result += getOrderedTableTeams(listeTableau[i])
}
result += `</div>
<div class="card-footer bg-light-subtle text-emphasis-light">${getSportNextMatchText(sportName)}</div>
</div>`
return result;
@@ -167,7 +173,7 @@ function getSportCard(sportName){
const sportCardContainer = document.getElementById("sportContainer");
let sportsList = SportList.reduce((accumulator, currentValue) => {
if(!(accumulator.some(elem => elem === currentValue.name))){
if (!(accumulator.some(elem => elem === currentValue.name))) {
accumulator.push(currentValue.name);
}
return accumulator;

View File

@@ -16,8 +16,8 @@ const MatchList = await pb.collection('match').getFullList({
const SportList = await pb.collection('sport').getFullList({});
function getSportIcon(sport){
switch(sport) {
function getSportIcon(sport) {
switch (sport) {
case "basketball":
return ` <span class="material-symbols-outlined">sports_basketball</span>`
case "volleyball":
@@ -31,19 +31,19 @@ function getSportIcon(sport){
}
}
function getTeamClassementBadge(equipe){
function getTeamClassementBadge(equipe) {
let color = ""
if(equipe.eliminated){
if (equipe.eliminated) {
color = "bg-danger"
} else {
color = "bg-primary"
}
if(equipe.stade !== ""){
if (equipe.stade !== "") {
let tournoi = SportList.find(sport => sport.name === equipe.expand.sport.name && sport.type === "tournois")
if(tournoi){
if(tournoi.state === "started"){
if (tournoi) {
if (tournoi.state === "started") {
let stade = ""
switch(equipe.stade){
switch (equipe.stade) {
case "16":
stade = "16èmes"
break;
@@ -61,11 +61,11 @@ function getTeamClassementBadge(equipe){
break;
}
return `<span class="badge ${color} rounded-pill">${stade}</span>`
} else if(tournoi.state === "finished"){
} else if (tournoi.state === "finished") {
let classement = "";
let color = ""
let textColor = ""
switch(equipe.stade){
switch (equipe.stade) {
case "16":
classement = "16èmes"
color = "bg-secondary"
@@ -79,7 +79,7 @@ function getTeamClassementBadge(equipe){
color = "bg-secondary"
break;
case "2":
if(equipe.eliminated){
if (equipe.eliminated) {
color = "bg-primary-subtle"
classement = "Quatrième"
} else {
@@ -88,7 +88,7 @@ function getTeamClassementBadge(equipe){
}
break;
case "1":
if(equipe.eliminated){
if (equipe.eliminated) {
color = "bg-success"
classement = "Second"
} else {
@@ -101,40 +101,40 @@ function getTeamClassementBadge(equipe){
return `<span class="badge ${color} rounded-pill ${textColor}">${classement}</span>`
}
}
}
if(equipe.classement !== 0){
}
if (equipe.classement !== 0) {
return `<span class="badge ${color} rounded-pill">${equipe.classement}/${numOfTeamsBySport[equipe.sport]}</span>`
}
return "";
}
function getTeamsRow(sport, teams){
let result = `
function getTeamsRow(sport, teams) {
let result = `
<li class="list-group-item">
<div class="mx-2">
<div class="fw-bold d-flex align-items-start">${getSportIcon(sport)}${sport[0].toUpperCase()}${sport.slice(1)}</div>`
teams.forEach(equipe => {
result += `<div class="d-flex justify-content-between align-items-start"><p class="mb-0">${equipe.name}</p>`
if(equipe.expand.sport.type === "poules"){
if (equipe.expand.sport.type === "poules") {
result += `<p class="text-secondary-emphasis fw-semibold mb-0">${equipe.expand.sport.tableau}</p>`
}
if(equipe.expand.sport.state !== "waiting"){
if (equipe.expand.sport.state !== "waiting") {
result += getTeamClassementBadge(equipe)
}
result += `</div>`
})
})
result += `</div>
</li>`
return result
}
function getPromoCard(promo, teamsBySport){
function getPromoCard(promo, teamsBySport) {
let title = ""
if(promo.points !== 0){
if (promo.points !== 0) {
let classement = PromoList.findIndex(e => e.id === promo.id);
title = `${classement+1}e ${promo.name} (${promo.points}pts)`
if(classement === 0){
title = `Vainqueur ${promo.name} (${promo.points}pts)`
title = `${classement + 1}e ${promo.name} (${promo.points}pts)`
if (classement === 0) {
title = `Vainqueur ${promo.name} (${promo.points}pts)`
}
} else {
title = promo.name;
@@ -144,29 +144,36 @@ function getPromoCard(promo, teamsBySport){
<div class="card-header text-center bg-light-subtle text-emphasis-light">${title}</div>
<ul class="list-group list-group-flush">
`
for(let [sport, teams] of Object.entries(teamsBySport)){
for (let [sport, teams] of Object.entries(teamsBySport)) {
cardHtml += getTeamsRow(sport, teams)
}
cardHtml += `</ul>`
//Cherche le prochain match de la promo qui est en status "waiting"
const nextMatch = MatchList.find(match => match.team1 && match.team2 && match.status === "waiting" && (match.expand.team1.promo === promo.id || match.expand.team2.promo === promo.id));
if(nextMatch){
if (nextMatch) {
const time_start = new Date(nextMatch.heure_debut);
if(nextMatch.team1 && nextMatch.team2){
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.expand.sport.name}</b> ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} ${time_start.toLocaleString('fr', { weekday: 'long' })} à ${time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' })}</div>`
if (nextMatch.team1 && nextMatch.team2) {
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.expand.sport.name}</b> ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} ${time_start.toLocaleString('fr', {weekday: 'long'})} à ${time_start.toLocaleString('fr', {
hour: 'numeric',
minute: 'numeric'
})}</div>`
} else {
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.name} ${time_start.toLocaleString('fr', { weekday: 'long' })} à ${time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' })}</div>`
} }
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.name} ${time_start.toLocaleString('fr', {weekday: 'long'})} à ${time_start.toLocaleString('fr', {
hour: 'numeric',
minute: 'numeric'
})}</div>`
}
}
cardHtml += `</div>`
return cardHtml
}
function getSportRow(equipe){
function getSportRow(equipe) {
let members = ""
if(equipe.capitaine !== ""){
if (equipe.capitaine !== "") {
members += `<u>${equipe.expand.capitaine.prenom} ${equipe.expand.capitaine.name}</u>, `;
}
if(equipe.membres.length !== 0){
if (equipe.membres.length !== 0) {
equipe.expand.membres.forEach(membre => {
members += `${membre.prenom[0]}. ${membre.name}, `;
});
@@ -174,37 +181,43 @@ function getSportRow(equipe){
} else {
members = "non renseignés"
}
let result = `
let result = `
<li class="list-group-item d-flex justify-content-between align-items-start">
<div class="mx-2">
<div class="fw-bold d-flex align-items-start">${getSportIcon(equipe.expand.sport.name)}${equipe.expand.sport.name[0].toUpperCase()}${equipe.expand.sport.name.slice(1)} (${equipe.expand.sport.tableau})</div>
Membres : ${members}
</div>`
if(equipe.expand.sport.state !== "waiting"){
if (equipe.expand.sport.state !== "waiting") {
result += getTeamClassementBadge(equipe)
}
result += `</li>`
return result
}
function getTeamCard(teamBySport){
function getTeamCard(teamBySport) {
let equipe = teamBySport['team']
let cardHtml = `
<div class="card my-3">
<div class="card-header text-center bg-light-subtle text-emphasis-light">${equipe.name}(${equipe.expand.promo.name})</div>
<ul class="list-group list-group-flush">
`
for(const [sportName, team] of Object.entries(teamBySport).filter(([sportName, team]) => sportName !== "team")){
for (const [sportName, team] of Object.entries(teamBySport).filter(([sportName, team]) => sportName !== "team")) {
cardHtml += getSportRow(team)
}
cardHtml += `</ul>`
const nextMatch = MatchList.find(match => match.team1 && match.team2 && match.status === "waiting" && (match.expand.team1.name === equipe.name || match.expand.team2.name === equipe.name));
if(nextMatch){
if (nextMatch) {
const time_start = new Date(nextMatch.heure_debut);
if(nextMatch.team1 && nextMatch.team2){
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.expand.sport.name}</b> ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} ${time_start.toLocaleString('fr', { weekday: 'long' })} à ${time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' })}</div>`
if (nextMatch.team1 && nextMatch.team2) {
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.expand.sport.name}</b> ${nextMatch.expand.team1.name} vs ${nextMatch.expand.team2.name} ${time_start.toLocaleString('fr', {weekday: 'long'})} à ${time_start.toLocaleString('fr', {
hour: 'numeric',
minute: 'numeric'
})}</div>`
} else {
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.name} ${time_start.toLocaleString('fr', { weekday: 'long' })} à ${time_start.toLocaleString('fr', { hour: 'numeric', minute: 'numeric' })}</div>`
cardHtml += `<div class="card-footer bg-light-subtle text-emphasis-light">Prochain match : <b>${nextMatch.name} ${time_start.toLocaleString('fr', {weekday: 'long'})} à ${time_start.toLocaleString('fr', {
hour: 'numeric',
minute: 'numeric'
})}</div>`
}
}
cardHtml += `</div>`
@@ -219,20 +232,20 @@ const teamSports = {} // Object key = team name, value = Object key = sport name
const numOfTeamsBySport = {}
EquipeList.forEach(equipe => {
if(!(equipe.expand.promo.name in promoTeamsbySport)){
if (!(equipe.expand.promo.name in promoTeamsbySport)) {
promoTeamsbySport[equipe.expand.promo.name] = {};
}
if(!(equipe.expand.sport.name in promoTeamsbySport[equipe.expand.promo.name])){
if (!(equipe.expand.sport.name in promoTeamsbySport[equipe.expand.promo.name])) {
promoTeamsbySport[equipe.expand.promo.name][equipe.expand.sport.name] = [];
}
promoTeamsbySport[equipe.expand.promo.name][equipe.expand.sport.name].push(equipe);
if(!(equipe.expand.sport.name === "badminton")){
if(!(equipe.name in teamSports)){
if (!(equipe.expand.sport.name === "badminton")) {
if (!(equipe.name in teamSports)) {
teamSports[equipe.name] = {'team': equipe};
}
teamSports[equipe.name][equipe.expand.sport.name] = equipe;
}
if(!(equipe.sport in numOfTeamsBySport)){
if (!(equipe.sport in numOfTeamsBySport)) {
numOfTeamsBySport[equipe.sport] = 0;
}
numOfTeamsBySport[equipe.sport] += 1;
@@ -241,7 +254,7 @@ EquipeList.forEach(equipe => {
//Affichage des équipes par promo
PromoList.forEach(promo => {
if(!(promo.name in promoTeamsbySport)){
if (!(promo.name in promoTeamsbySport)) {
promoTeamsbySport[promo.name] = {}
}
promoCardContainer.insertAdjacentHTML("beforeend", getPromoCard(promo, promoTeamsbySport[promo.name]));

View File

@@ -2,10 +2,10 @@ document.cookie = "icons=wifi_tethering,trophy,fitness_center,login; expires=Fri
document.cookie = "hideImage=true; expires=Fri, 10 Nov 2023 12:00:00 UTC; path=/";
function getCookie(name){
function getCookie(name) {
let value = "; " + document.cookie;
let parts = value.split("; " + name + "=");
if(parts.length === 2) return parts.pop().split(";").shift();
if (parts.length === 2) return parts.pop().split(";").shift();
}
let iconData = getCookie("icons");
@@ -14,7 +14,7 @@ let iconList = iconData.split(",");
let iconContainer = document.querySelectorAll(".icons-display");
for(let i = 0; i < iconContainer.length; i++){
for (let i = 0; i < iconContainer.length; i++) {
let icon = document.createElement("span");
icon.className = "material-symbols-outlined";
icon.innerHTML = iconList[i];
@@ -25,9 +25,8 @@ for(let i = 0; i < iconContainer.length; i++){
let hideImage = getCookie("hideImage");
if(hideImage === "true"){
if (hideImage === "true") {
document.querySelector(".logo-appen").style.display = "none";
}
else{
} else {
document.querySelector(".logo-appen").style.display = "block";
}

File diff suppressed because one or more lines are too long

View File

@@ -1,84 +1,93 @@
<!DOCTYPE html>
<html lang="fr" data-bs-theme="dark">
<head>
<meta charset="utf-8">
<title> Connexion </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!--- Ajout d'un fichier css pour les classes personalisé --->
<link rel="stylesheet" href="style.css" />
<script src="js/cookie.js" defer></script>
<link rel="icon" href="assets/appen.png">
<script src="js/backend/login.js" type="module"></script>
<meta charset="utf-8">
<title> Connexion </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!--- Ajout d'un fichier css pour les classes personalisé --->
<link rel="stylesheet" href="style.css"/>
<script src="js/cookie.js" defer></script>
<link rel="icon" href="assets/appen.png">
<script src="js/backend/login.js" type="module"></script>
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30" class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30"
class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" aria-current="page" href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex active align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" aria-current="page" href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex active align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
</div>
</nav>
</div>
</nav>
</header>
<div class="container">
<div class="col-8 offset-2 mt-6">
<div class="alert alert-danger" role="alert" id="LoginImposible" style="display: none">
Connexion impossible, veuillez vérifier vos identifiants !
<div class="col-8 offset-2 mt-6">
<div class="alert alert-danger" role="alert" id="LoginImposible" style="display: none">
Connexion impossible, veuillez vérifier vos identifiants !
</div>
<h2 class="text-center">Connexion</h2>
<br>
<form class="text-center align-items-center">
<label for="LoginID" class="form-label">Identifiant</label>
<input type="email" class="form-control" id="LoginID" placeholder="exemple@appen.fr">
<br>
<label for="LoginPassword" class="form-label">Mot de passe</label>
<input type="password" class="form-control" id="LoginPassword" placeholder="Mot de passe">
<div class="text-center">
<button type="submit" class="btn btn-primary btn-lg btn-block mt-4">Connexion</button>
</div>
</form>
</div>
<h2 class="text-center">Connexion</h2>
<br>
<form class="text-center align-items-center">
<label for="LoginID" class="form-label">Identifiant</label>
<input type="email" class="form-control" id="LoginID" placeholder="exemple@appen.fr">
<br>
<label for="LoginPassword" class="form-label">Mot de passe</label>
<input type="password" class="form-control" id="LoginPassword" placeholder="Mot de passe">
<div class="text-center"><button type="submit" class="btn btn-primary btn-lg btn-block mt-4">Connexion</button></div>
</form>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -1,72 +1,80 @@
<!DOCTYPE html>
<html lang="fr" data-bs-theme="dark">
<head>
<head>
<meta charset="utf-8">
<title> Liste des Sports </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!--- Ajout d'un fichier css pour les classes personalisé --->
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style.css"/>
<script src="js/cookie.js" defer></script>
<link rel="icon" href="assets/appen.png">
<script src="js/backend/sport.js" type="module" defer></script>
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30" class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30"
class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link active d-inline-flex align-items-center" aria-current="page" href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link active d-inline-flex align-items-center" aria-current="page"
href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
</nav>
</header>
<div class="container mt-6">
<div class="col-8 offset-2" id="sportContainer">
<div class="container mt-6">
<div class="col-8 offset-2" id="sportContainer">
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
</body>
</html>

View File

@@ -1,3 +1,3 @@
.mt-6 {
margin-top: 6rem !important;
}
}

View File

@@ -1,73 +1,81 @@
<!DOCTYPE html>
<html lang="fr" data-bs-theme="dark">
<head>
<head>
<meta charset="utf-8">
<title> Classement et équipes </title>
<title> Classement et équipes </title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" />
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<link rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200"/>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.min.css" rel="stylesheet"
integrity="sha384-T3c6CoIi6uLrA9TneNEoa7RxnatzjcDSCmG1MXxSR1GAsXEV/Dwwykc2MPK8M2HN" crossorigin="anonymous">
<!--- Ajout d'un fichier css pour les classes personalisé --->
<link rel="stylesheet" href="style.css" />
<link rel="stylesheet" href="style.css"/>
<script src="js/cookie.js" defer></script>
<link rel="icon" href="assets/appen.png">
<script src="js/backend/team.js" type="module" defer></script>
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
</head>
<body>
<header>
<nav class="navbar navbar-dark bg-dark fixed-top">
<div class="container-fluid">
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30" class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<a class="navbar-brand" href="index.html">
<img src="assets/appen.png" alt="Logo" width="30" height="30"
class="d-inline-block align-text-top logo-appen">
Interpromos 2023
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent" aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse"
data-bs-target="#navbarToggleExternalContent" aria-controls="navbarToggleExternalContent"
aria-expanded="false" aria-label="Ouvrir la navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link active d-inline-flex align-items-center" aria-current="page" href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
<div class="collapse text-bg-dark" id="navbarToggleExternalContent" data-bs-theme="dark">
<ul class="navbar-nav justify-content-end flex-grow-1 pe-3">
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="index.html">
<div class="pe-3 icons-display"></div>
Matchs en direct
</a>
</li>
<li class="nav-item">
<a class="nav-link active d-inline-flex align-items-center" aria-current="page"
href="teams.html">
<div class="pe-3 icons-display"></div>
Classement et équipes
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="sports.html">
<div class="pe-3 icons-display"></div>
Liste des sports
</a>
</li>
<li class="nav-item">
<a class="nav-link d-inline-flex align-items-center" href="login.html">
<div class="pe-3 icons-display"></div>
Connexion
</a>
</li>
</ul>
</div>
</div>
</nav>
</header>
</nav>
</header>
<div class="container mt-6">
<h2>Classement des Promos</h2>
<div class="col-8 offset-2" id="promoCardContainer"></div>
<hr>
<h2>Classement des équipes</h2>
<div class="col-8 offset-2" id="teamCardContainer"></div>
</div>
<div class="container mt-6">
<h2>Classement des Promos</h2>
<div class="col-8 offset-2" id="promoCardContainer"></div>
<hr>
<h2>Classement des équipes</h2>
<div class="col-8 offset-2" id="teamCardContainer"></div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js" integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL" crossorigin="anonymous"></script>
</body>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/js/bootstrap.bundle.min.js"
integrity="sha384-C6RzsynM9kWDrMNeT87bh95OGNyZPhcTNXj1NW7RuBCsyN/o0jlpcV8Qyq46cDfL"
crossorigin="anonymous"></script>
</body>
</html>