|
|
|
|
@ -151,6 +151,7 @@ |
|
|
|
|
has_sponsors: {{ tournament.has_sponsors|lower }}, |
|
|
|
|
matchGroups: [], |
|
|
|
|
courtCount: {{ tournament.court_count|default:1 }}, |
|
|
|
|
courtNames: {{ tournament.court_names }}, |
|
|
|
|
retrieveData() { |
|
|
|
|
fetch('/tournament/{{ tournament.id }}/planning/json/') |
|
|
|
|
.then(res => res.json()) |
|
|
|
|
@ -211,10 +212,9 @@ |
|
|
|
|
return paginatedGroups; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
getCourtNumber(courtName) { |
|
|
|
|
if (!courtName) return 999; |
|
|
|
|
const match = courtName.match(/(\d+)/); |
|
|
|
|
return match ? parseInt(match[1]) : 999; |
|
|
|
|
getCourtNumber(courtIndex) { |
|
|
|
|
if (!courtIndex) return 999; |
|
|
|
|
return courtIndex; |
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
organizeMatchesByCourt(matches) { |
|
|
|
|
@ -222,7 +222,7 @@ |
|
|
|
|
if (matches && matches.length > 0) { |
|
|
|
|
matches.forEach(match => { |
|
|
|
|
if (match && match.court) { |
|
|
|
|
const courtNum = this.getCourtNumber(match.court); |
|
|
|
|
const courtNum = this.getCourtNumber(match.court_index); |
|
|
|
|
if (courtNum > 0 && courtNum <= this.courtCount) { |
|
|
|
|
courtMatches[courtNum - 1] = match; |
|
|
|
|
} |
|
|
|
|
@ -289,10 +289,10 @@ |
|
|
|
|
<h1 class="timeslot">00:00</h1> |
|
|
|
|
</div> |
|
|
|
|
<div class="courts-row" style="margin-left: 10px; margin-bottom: -10px;"> |
|
|
|
|
<template x-for="courtNum in Array.from({length: courtCount || 1}, (_, i) => i + 1)" :key="courtNum"> |
|
|
|
|
<template x-for="courtName in courtNames" :key="courtName"> |
|
|
|
|
<div class="court-label" :style="{'width': calculateFractionWidth()}"> |
|
|
|
|
<div class="bubble"> |
|
|
|
|
<div class="score ws bold">Piste <span x-text="courtNum"></span></div> |
|
|
|
|
<div class="score ws bold"><span x-text="courtName"></span></div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
@ -305,10 +305,10 @@ |
|
|
|
|
<h1 class="timeslot">00:00</h1> |
|
|
|
|
</div> |
|
|
|
|
<div class="courts-row" style="margin-bottom: -10px;"> |
|
|
|
|
<template x-for="courtNum in Array.from({length: courtCount || 1}, (_, i) => i + 1)" :key="courtNum"> |
|
|
|
|
<template x-for="courtName in courtNames" :key="courtName"> |
|
|
|
|
<div class="court-label" :style="{'width': calculateFractionWidth()}"> |
|
|
|
|
<div class="bubble"> |
|
|
|
|
<div class="score ws bold">Piste <span x-text="courtNum"></span></div> |
|
|
|
|
<div class="score ws bold"><span x-text="courtName"></span></div> |
|
|
|
|
</div> |
|
|
|
|
</div> |
|
|
|
|
</template> |
|
|
|
|
|