Enha: attempt to do modal popup of clue; must be a better way
This commit is contained in:
@ -240,3 +240,29 @@ func HandleJoinRoom(w http.ResponseWriter, r *http.Request) {
|
||||
}
|
||||
tmpl.ExecuteTemplate(w, "room", fi)
|
||||
}
|
||||
|
||||
func HandleGiveClue(w http.ResponseWriter, r *http.Request) {
|
||||
if err := r.ParseForm(); err != nil {
|
||||
abortWithError(w, err.Error())
|
||||
return
|
||||
}
|
||||
clue := r.PostFormValue("clue")
|
||||
num := r.PostFormValue("number")
|
||||
fi, err := getFullInfoByCtx(r.Context())
|
||||
if err != nil {
|
||||
abortWithError(w, err.Error())
|
||||
return
|
||||
}
|
||||
fi.Room.MimeDone = true
|
||||
notify(models.NotifyMimePrefix+fi.Room.ID, clue+num)
|
||||
if err := saveFullInfo(fi); err != nil {
|
||||
abortWithError(w, err.Error())
|
||||
return
|
||||
}
|
||||
// tmpl, err := template.ParseGlob("components/*.html")
|
||||
// if err != nil {
|
||||
// abortWithError(w, err.Error())
|
||||
// return
|
||||
// }
|
||||
// tmpl.ExecuteTemplate(w, "room", fi)
|
||||
}
|
||||
|
Reference in New Issue
Block a user