diff --git a/src/main/webapp/public/competition.js b/src/main/webapp/public/competition.js index 9b2b7c1..28cde4b 100644 --- a/src/main/webapp/public/competition.js +++ b/src/main/webapp/public/competition.js @@ -270,6 +270,35 @@ function buildTree(treeData) { return drawGraph(initTree(treeData.filter(d => d.data.level >= 0))) } +function buildClassementArray(classement) { + const classement2 = classement.sort((a, b) => { + if (a.rank === b.rank) + return a.name.localeCompare(b.name); + return a.rank - b.rank; + }) + + const arrayDiv = document.createElement('div'); + let arrayContent = `
+ + + + + + + ` + for (const row of classement2) { + arrayContent += ` + + + + ` + + } + arrayContent += `
${i18next.t('place')}${i18next.t('nom')}
${row.rank}${row.name}
` + arrayDiv.innerHTML = arrayContent; + return arrayDiv; +} + function poulePage(location) { rootDiv.innerHTML = `

${i18next.t('résultatDeLaCompétition')} :

${i18next.t('back')}`; document.getElementById('homeLink').addEventListener('click', () => setSubPage('home')); @@ -343,6 +372,9 @@ function poulePage(location) { date: d.data.date, })))); } + if (poule['treeIsClassement']){ + dataContainer.append(buildClassementArray(poule['classement'])); + } } location[2] = isPoule ? 1 : 2; diff --git a/src/main/webapp/src/pages/result/ResultView.jsx b/src/main/webapp/src/pages/result/ResultView.jsx index 93fd60e..5557842 100644 --- a/src/main/webapp/src/pages/result/ResultView.jsx +++ b/src/main/webapp/src/pages/result/ResultView.jsx @@ -181,8 +181,8 @@ function ClassementList({classement}) { - - + +
PlaceNom{t('place')}{t('nom')}