Enha: attempt to do modal popup of clue; must be a better way
This commit is contained in:
		| @@ -49,7 +49,10 @@ func HandleNameCheck(w http.ResponseWriter, r *http.Request) { | ||||
| } | ||||
|  | ||||
| func HandleFrontLogin(w http.ResponseWriter, r *http.Request) { | ||||
| 	r.ParseForm() | ||||
| 	if err := r.ParseForm(); err != nil { | ||||
| 		abortWithError(w, err.Error()) | ||||
| 		return | ||||
| 	} | ||||
| 	username := r.PostFormValue("username") | ||||
| 	if username == "" { | ||||
| 		msg := "username not provided" | ||||
|   | ||||
| @@ -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
	 Grail Finder
					Grail Finder