diff --git a/tournaments/static/tournaments/js/tournament_bracket.js b/tournaments/static/tournaments/js/tournament_bracket.js index 8407191..85a9e67 100644 --- a/tournaments/static/tournaments/js/tournament_bracket.js +++ b/tournaments/static/tournaments/js/tournament_bracket.js @@ -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(); + } } diff --git a/tournaments/templates/tournaments/broadcast/broadcasted_bracket.html b/tournaments/templates/tournaments/broadcast/broadcasted_bracket.html index 45e93d8..9899d1f 100644 --- a/tournaments/templates/tournaments/broadcast/broadcasted_bracket.html +++ b/tournaments/templates/tournaments/broadcast/broadcasted_bracket.html @@ -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 = `