Skip to content
Permalink
Browse files

results: Fix formatting error when only one round

Fix formatting of the results tables when an event only has one round or when
events in a multi-event ranking have different numbers of rounds.
  • Loading branch information...
Andreas Gruenbacher
Andreas Gruenbacher committed Jun 23, 2019
1 parent 39ff143 commit 734d8b91f83fbfaaadf31f1409e7d7dc8b596eed
Showing with 9 additions and 9 deletions.
  1. +9 −9 htdocs/admin/event/results/view.html
@@ -155,13 +155,13 @@ <h3 ng-if="ranking.name">{{class_ranking.name}}</h3>
<th ng-if="events.length > 1" colspan="{{1 + marks_distribution_columns + class_ranking.scores}}" style="text-align:center">Gesamt</th>
</tr>
<tr>
<th style="text-align:center" ng-bind-html="class_symbol(class_ranking)" adjust-width="rank" style="border-left:10px solid #98bf21;">></th>
<th style="text-align:center" ng-bind-html="class_symbol(class_ranking)" adjust-width="rank" style="border-left:10px solid #98bf21;"></th>
<th ng-repeat="field in fields track by $index" ng-attr="field.attr" ng-style="field.style" ng-bind-html="field.heading"></th>
<th ng-repeat-start="ev in enumerate(0, events.length - 1)" ng-init="event_ranking = class_ranking.events[ev]" style="display:none"></th>
<th rowspan="{{rows_per_rider}}" style="display:none"></th>
<th style="text-align:right; width:1.2em" ng-repeat="zone in (features.individual_marks ? event_ranking.zones : [])" title="Sektion {{zone}}" adjust-width="individual-marks">S{{zone}}</th>
<th ng-if="features.individual_marks && rounds > 1" adjust-width="marks"><span title="Runde">R</span></th>
<th ng-repeat="round in ((!features.individual_marks && rounds > 1) ? enumerate(1, rounds) : [])" style="text-align:right" adjust-width="marks"><span title="Runde {{round}}">R{{round}}</span></th>
<th ng-if="features.individual_marks" adjust-width="marks"><span title="Runde">R</span></th>
<th ng-repeat="round in (!features.individual_marks ? enumerate(1, event_ranking.rounds) : [])" style="text-align:right" adjust-width="marks"><span title="Runde {{round}}">R{{round}}</span></th>
<th style="text-align:right" ng-if="event_ranking.additional_marks" adjust-width="marks"><span title="Zusatzpunkte">ZP</span></th>
<th style="text-align:right" ng-if="event_ranking.penalty_marks" adjust-width="marks"><span title="Zeit- und Strafpunkte">SP</span></th>
<th style="text-align:right" adjust-width="sum-marks"><span title="Punkte">Σ</span></th>
@@ -189,19 +189,19 @@ <h3 ng-if="ranking.name">{{class_ranking.name}}</h3>
<td rowspan="{{rows_per_rider}}" style="text-align:right">{{rank(rider)}}</td>
<td rowspan="{{rows_per_rider}}" ng-repeat="field in fields track by $index" ng-style="field.style">{{$eval(field.expr, rider)}}</td>
<td ng-repeat-start="ev in enumerate(0, events.length - 1)" ng-init="result = rider.results[ev]; event_ranking = class_ranking.events[ev]" style="display:none"></td>
<td ng-if="!result" colspan="{{(features.individual_marks ? event_ranking.zones.length + 1 : rounds) + 1 + event_ranking.additional_marks + event_ranking.penalty_marks + event_ranking.tie_break + marks_distribution_columns}}" rowspan="{{features.individual_marks ? rounds : 1}}"></td>
<td ng-if="!result" colspan="{{(features.individual_marks ? event_ranking.zones.length + 1 : event_ranking.rounds) + 1 + event_ranking.additional_marks + event_ranking.penalty_marks + event_ranking.tie_break + marks_distribution_columns}}" rowspan="{{features.individual_marks ? rounds : 1}}"></td>
<td ng-if-start="result.failure || result.non_competing" style="display:none"></td>
<td ng-repeat="zone in (features.individual_marks ? event_ranking.zones : [])" style="text-align:right" class="individual-marks">{{result.marks_in_zone(1, zone)}}</td>
<td ng-if="features.individual_marks && rounds > 1" style="text-align:right" class="round {{result.decisive_round == 1 ? 'important' : ''}}" ng-bind-html="result.marks_in_round(1)"></td>
<td ng-repeat="round in ((!features.individual_marks && rounds > 1) ? enumerate(1, rounds) : [])" rowspan="{{rows_per_rider}}" style="text-align:right" class="round {{result.decisive_round == round ? 'important' : ''}}" ng-bind-html="result.marks_in_round(round)"></td>
<td ng-if="features.individual_marks" style="text-align:right" class="round {{result.decisive_round == 1 ? 'important' : ''}}" ng-bind-html="result.marks_in_round(1)"></td>
<td ng-repeat="round in (!features.individual_marks ? enumerate(1, event_ranking.rounds) : [])" rowspan="{{rows_per_rider}}" style="text-align:right" class="round {{result.decisive_round == round ? 'important' : ''}}" ng-bind-html="result.marks_in_round(round)"></td>
<td rowspan="{{rows_per_rider}}" style="text-align:right" ng-if="event_ranking.additional_marks">{{result.additional_marks | fractional}}</td>
<td rowspan="{{rows_per_rider}}" style="text-align:right" ng-if="event_ranking.penalty_marks">{{result.penalty_marks | fractional}}</td>
<td rowspan="{{rows_per_rider}}" style="text-align:center;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;max-width:0" colspan="{{1 + event_ranking.tie_break + marks_distribution_columns}}"><span title="{{failure(result)}}">{{failure(result)}}</span></td>
<td ng-if-end style="display:none"></td>
<td ng-if-start="result && !(result.failure || result.non_competing)" style="display:none"></td>
<td ng-repeat="zone in (features.individual_marks ? event_ranking.zones : [])" style="text-align:right" class="individual-marks">{{result.marks_in_zone(1, zone)}}</th>
<td ng-if="features.individual_marks && rounds > 1" style="text-align:right" class="round {{result.decisive_round == 1 ? 'important' : ''}}" ng-bind-html="result.marks_in_round(1)"></td>
<td ng-repeat="round in ((!features.individual_marks && rounds > 1) ? enumerate(1, rounds) : [])" rowspan="{{rows_per_rider}}" style="text-align:right" class="round {{result.decisive_round == round ? 'important' : ''}}" ng-bind-html="result.marks_in_round(round)"></td>
<td ng-if="features.individual_marks" style="text-align:right" class="round {{result.decisive_round == 1 ? 'important' : ''}}" ng-bind-html="result.marks_in_round(1)"></td>
<td ng-repeat="round in (!features.individual_marks ? enumerate(1, event_ranking.rounds) : [])" rowspan="{{rows_per_rider}}" style="text-align:right" class="round {{result.decisive_round == round ? 'important' : ''}}" ng-bind-html="result.marks_in_round(round)"></td>
<td rowspan="{{rows_per_rider}}" style="text-align:right" ng-if="event_ranking.additional_marks">{{result.additional_marks | fractional}}</td>
<td rowspan="{{rows_per_rider}}" style="text-align:right" ng-if="event_ranking.penalty_marks">{{result.penalty_marks | fractional}}</td>
<td rowspan="{{rows_per_rider}}" style="text-align:right">{{result.marks | fractional}}</td>
@@ -226,7 +226,7 @@ <h3 ng-if="ranking.name">{{class_ranking.name}}</h3>
<tr ng-repeat="round in (features.individual_marks ? enumerate(2, rounds) : [])">
<td ng-repeat-start="ev in enumerate(0, events.length - 1)" ng-if-start="rider.results[ev]" ng-init="result = rider.results[ev]; event_ranking = class_ranking.events[ev]" style="display:none"></td>
<td ng-repeat="zone in event_ranking.zones" style="text-align:right" class="individual-marks">{{result.marks_in_zone(round, zone)}}</td>
<td ng-if="rounds > 1" style="text-align:right" class="round {{result.decisive_round == round ? 'important' : ''}}" ng-bind-html="result.marks_in_round(round)"></td>
<td style="text-align:right" class="round {{result.decisive_round == round ? 'important' : ''}}" ng-bind-html="result.marks_in_round(round)"></td>
<td ng-repeat-end ng-if-end style="display:none"></td>
</tr>
</tbody>

0 comments on commit 734d8b9

Please sign in to comment.
You can’t perform that action at this time.