Fixed match review page.

This commit is contained in:
Patrick Fairbank
2014-07-07 22:42:17 -07:00
parent 9d449f0b87
commit 257fa715bc
3 changed files with 15 additions and 3 deletions

View File

@@ -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 {

View File

@@ -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

View File

@@ -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;
}