fix bracket template

sync_v2
Raz 7 months ago
parent 348c069817
commit 0470d80379
  1. 13
      tournaments/static/tournaments/js/tournament_bracket.js
  2. 1
      tournaments/templates/tournaments/broadcast/broadcasted_bracket.html

@ -201,8 +201,8 @@ function renderBracket(options) {
}
}
} else if (
(realRoundIndex == roundIndex && roundIndex <= finalRoundIndex) ||
(realRoundIndex != roundIndex && roundIndex < finalRoundIndex)
(roundIndex == finalRoundIndex && realRoundIndex != 0) ||
roundIndex < finalRoundIndex
) {
const parentIndex1 = matchRealIndex * 2 + 1;
const parentIndex2 = matchRealIndex * 2 + 2;
@ -332,7 +332,10 @@ function renderBracket(options) {
// Position title above the first match
titleDiv.style.top = `${-80}px`; // Adjust the 60px offset as needed
if (roundIndex == finalRoundIndex && realRoundIndex == 0) {
if (
(roundIndex == finalRoundIndex && realRoundIndex == 0) ||
isBroadcast == true
) {
titleDiv.style.top = `${top - 80}px`; // Adjust the 60px offset as needed
}
titleDiv.style.position = "absolute";
@ -442,5 +445,7 @@ function renderBracket(options) {
`${spacerHeight}px`;
}
adjustSpacerHeight();
if (isBroadcast == false) {
adjustSpacerHeight();
}
}

@ -125,6 +125,7 @@
template.dataset.matchTitle = match.title;
template.dataset.roundId = group.round_id;
template.dataset.matchRealIndex = match.index;
template.dataset.roundIndex = group.round_index;
// Create the match content using our HTML generator
template.innerHTML = `<div class="bubble broadcast-bracket-match ${(!match.ended && match.started) ? 'match-running' : ''}">${createMatchHTML(match)}</div>`;

Loading…
Cancel
Save