// championshipSubmitEventConfigurationHandler takes an Event Configuration from a form and
// builds an event optionally, this is used for editing ChampionshipEvents.
championshipSubmitEventConfigurationHandler takes an Event Configuration from a form and
builds an event optionally, this is used for editing ChampionshipEvents.
// championshipSubmitEventConfigurationHandler takes an Event Configuration from a form and // builds an event optionally this is used for editing ChampionshipEvents .
func championshipSubmitEventConfigurationHandler(w http.ResponseWriter, r *http.Request) {
	championship, event, edited, err := championshipManager.SaveChampionshipEvent(r)
	if err != nil {
		logrus.Errorf("couldn't build championship race, err: %s", err)
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}
	if edited {
		AddFlashQuick(w, r,
			fmt.Sprintf(
				"Championship race at %s was successfully edited!",
				prettifyName(event.RaceSetup.Track, false),
			),
		)
	} else {
		AddFlashQuick(w, r,
			fmt.Sprintf(
				"Championship race at %s was successfully added!",
				prettifyName(event.RaceSetup.Track, false),
			),
		)
	}
	if r.FormValue("action") == "saveChampionship" {
		http.Redirect(w, r, "/championship/"+championship.ID.String(), http.StatusFound)
		return
	} else {
		http.Redirect(w, r, "/championship/"+championship.ID.String()+"/event", http.StatusFound)
	}
}
func championshipSubmitEventConfigurationHandler ( w http . ResponseWriter , r * http . Request ) { championship , event , edited , err := championshipManager . SaveChampionshipEvent ( r ) if err != nil { logrus . Errorf ( " " , err ) http . Error ( w , http . StatusText ( http . StatusInternalServerError ) , http . StatusInternalServerError ) return } if edited { AddFlashQuick ( w , r , fmt . Sprintf ( " " , prettifyName ( event . RaceSetup . Track , false ) , ) , ) } else { AddFlashQuick ( w , r , fmt . Sprintf ( " " , prettifyName ( event . RaceSetup . Track , false ) , ) , ) } if r . FormValue ( " " ) == " " { http . Redirect ( w , r , " " + championship . ID . String ( ) , http . StatusFound ) return } else { http . Redirect ( w , r , " " + championship . ID . String ( ) + " " , http . StatusFound ) } }
championshipSubmitEventConfigurationHandler takes an Event Configuration from a form and
builds an event optionally, this is used for editing ChampionshipEvents.
championshipSubmitEventConfigurationHandler takes an Event Configuration from a form and builds an event optionally this is used for editing ChampionshipEvents .
// end the race creation flow // add another event