// viewChampionshipHandler shows details of a given Championship
viewChampionshipHandler shows details of a given Championship
// viewChampionshipHandler shows details of a given Championship
func viewChampionshipHandler(w http.ResponseWriter, r *http.Request) {
	championship, err := championshipManager.LoadChampionship(chi.URLParam(r, "championshipID"))
	if err != nil {
		logrus.Errorf("couldn't load championship, err: %s", err)
		http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError)
		return
	}
	eventInProgress := false
	for _, event := range championship.Events {
		if event.InProgress() {
			eventInProgress = true
			break
		}
	}
	ViewRenderer.MustLoadTemplate(w, r, "championships/view.html", map[string]interface{}{
		"Championship":    championship,
		"EventInProgress": eventInProgress,
	})
}
func viewChampionshipHandler ( w http . ResponseWriter , r * http . Request ) { championship , err := championshipManager . LoadChampionship ( chi . URLParam ( r , " " ) ) if err != nil { logrus . Errorf ( " " , err ) http . Error ( w , http . StatusText ( http . StatusInternalServerError ) , http . StatusInternalServerError ) return } eventInProgress := false for _ , event := range championship . Events { if event . InProgress ( ) { eventInProgress = true break } } ViewRenderer . MustLoadTemplate ( w , r , " " , map [ string ] interface { } { " " : championship , " " : eventInProgress , } ) }
viewChampionshipHandler shows details of a given Championship
viewChampionshipHandler shows details of a given Championship