Feat: add backlog
This commit is contained in:
		| @@ -66,6 +66,14 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 	} | ||||
| 	fi.Room.RevealSpecificWord(word) | ||||
| 	fi.Room.UpdateCounter() | ||||
| 	action := models.Action{ | ||||
| 		Actor:      fi.State.Username, | ||||
| 		ActorColor: string(fi.State.Team), | ||||
| 		WordColor:  color, | ||||
| 		Action:     "guessed", | ||||
| 		Word:       word, | ||||
| 	} | ||||
| 	fi.Room.ActionHistory = append(fi.Room.ActionHistory, action) | ||||
| 	// if opened card is of color of opp team, change turn | ||||
| 	switch color { | ||||
| 	case "black": | ||||
| @@ -83,3 +91,17 @@ func HandleShowColor(w http.ResponseWriter, r *http.Request) { | ||||
| 	notify(models.NotifyRoomUpdatePrefix+fi.Room.ID, "") | ||||
| 	tmpl.ExecuteTemplate(w, "cardword", cardword) | ||||
| } | ||||
|  | ||||
| func HandleActionHistory(w http.ResponseWriter, r *http.Request) { | ||||
| 	fi, err := getFullInfoByCtx(r.Context()) | ||||
| 	if err != nil { | ||||
| 		abortWithError(w, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 	tmpl, err := template.ParseGlob("components/*.html") | ||||
| 	if err != nil { | ||||
| 		abortWithError(w, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 	tmpl.ExecuteTemplate(w, "actionhistory", fi.Room.ActionHistory) | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder