Don't show 0-0 scores on match review page for matches that haven't been played yet.

This commit is contained in:
Patrick Fairbank
2022-08-22 17:16:04 -07:00
parent 4d3d270a0f
commit 1896136abd
2 changed files with 7 additions and 2 deletions

View File

@@ -44,8 +44,8 @@
<td class="text-center blue-text"> <td class="text-center blue-text">
{{index $match.BlueTeams 0}}, {{index $match.BlueTeams 1}}, {{index $match.BlueTeams 2}} {{index $match.BlueTeams 0}}, {{index $match.BlueTeams 1}}, {{index $match.BlueTeams 2}}
</td> </td>
<td class="text-center red-text">{{$match.RedScore}}</td> <td class="text-center red-text">{{if $match.IsComplete}}{{$match.RedScore}}{{end}}</td>
<td class="text-center blue-text">{{$match.BlueScore}}</td> <td class="text-center blue-text">{{if $match.IsComplete}}{{$match.BlueScore}}{{end}}</td>
<td class="text-center nowrap"> <td class="text-center nowrap">
<a href="/match_review/{{$match.Id}}/edit"><b class="btn btn-info btn-xs">Edit</b></a> <a href="/match_review/{{$match.Id}}/edit"><b class="btn btn-info btn-xs">Edit</b></a>
</td> </td>

View File

@@ -24,6 +24,7 @@ type MatchReviewListItem struct {
RedScore int RedScore int
BlueScore int BlueScore int
ColorClass string ColorClass string
IsComplete bool
} }
// Shows the match review interface. // Shows the match review interface.
@@ -196,12 +197,16 @@ func (web *Web) buildMatchReviewList(matchType string) ([]MatchReviewListItem, e
switch match.Status { switch match.Status {
case game.RedWonMatch: case game.RedWonMatch:
matchReviewList[i].ColorClass = "danger" matchReviewList[i].ColorClass = "danger"
matchReviewList[i].IsComplete = true
case game.BlueWonMatch: case game.BlueWonMatch:
matchReviewList[i].ColorClass = "info" matchReviewList[i].ColorClass = "info"
matchReviewList[i].IsComplete = true
case game.TieMatch: case game.TieMatch:
matchReviewList[i].ColorClass = "warning" matchReviewList[i].ColorClass = "warning"
matchReviewList[i].IsComplete = true
default: default:
matchReviewList[i].ColorClass = "" matchReviewList[i].ColorClass = ""
matchReviewList[i].IsComplete = false
} }
} }