mirror of
https://github.com/Team254/cheesy-arena-lite.git
synced 2026-03-09 21:56:50 -04:00
Fixed match review page.
This commit is contained in:
@@ -73,6 +73,18 @@ type ScoreSummary struct {
|
||||
Score int
|
||||
}
|
||||
|
||||
// Returns a new match result object with empty slices instead of nil.
|
||||
func NewMatchResult() *MatchResult {
|
||||
matchResult := new(MatchResult)
|
||||
matchResult.RedScore.Cycles = []Cycle{}
|
||||
matchResult.BlueScore.Cycles = []Cycle{}
|
||||
matchResult.RedFouls = []Foul{}
|
||||
matchResult.BlueFouls = []Foul{}
|
||||
matchResult.Cards.YellowCardTeamIds = []int{}
|
||||
matchResult.Cards.RedCardTeamIds = []int{}
|
||||
return matchResult
|
||||
}
|
||||
|
||||
func (database *Database) CreateMatchResult(matchResult *MatchResult) error {
|
||||
matchResultDb, err := matchResult.serialize()
|
||||
if err != nil {
|
||||
|
||||
@@ -140,7 +140,7 @@ func getMatchResultFromRequest(r *http.Request) (*Match, *MatchResult, error) {
|
||||
}
|
||||
if matchResult == nil {
|
||||
// We're scoring a match that hasn't been played yet, but that's okay.
|
||||
matchResult = new(MatchResult)
|
||||
matchResult = NewMatchResult()
|
||||
}
|
||||
|
||||
return match, matchResult, nil
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// Bootstrap overrides.
|
||||
/* Bootstrap overrides. */
|
||||
.form-control[disabled] {
|
||||
cursor: default;
|
||||
}
|
||||
@@ -7,7 +7,7 @@
|
||||
opacity: 0.2;
|
||||
}
|
||||
|
||||
// New styles.
|
||||
/* New styles. */
|
||||
.red-text {
|
||||
color: #f00;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user