fix previous commit
This commit is contained in:
parent
38a162e416
commit
f5fc7c0ff3
@ -440,7 +440,7 @@ func (self *httpFrontend) new_captcha_json(wr http.ResponseWriter, r *http.Reque
|
||||
func (self *httpFrontend) handle_newboard(wr http.ResponseWriter, r *http.Request) {
|
||||
param := make(map[string]interface{})
|
||||
param["prefix"] = self.prefix
|
||||
io.WriteString(wr, template.renderTemplate("newboard.mustache", param, self.cache.GetHandler().GetI18N(r)))
|
||||
io.WriteString(wr, template.renderTemplate("newboard", param, self.cache.GetHandler().GetI18N(r)))
|
||||
}
|
||||
|
||||
// handle new post via http request for a board
|
||||
@ -616,7 +616,7 @@ func (self *httpFrontend) handle_postform(wr http.ResponseWriter, r *http.Reques
|
||||
resp_map["prefix"] = self.prefix
|
||||
resp_map["redirect_url"] = url
|
||||
resp_map["reason"] = "captcha incorrect"
|
||||
io.WriteString(wr, template.renderTemplate("post_fail.mustache", resp_map, self.cache.GetHandler().GetI18N(r)))
|
||||
io.WriteString(wr, template.renderTemplate("post_fail", resp_map, self.cache.GetHandler().GetI18N(r)))
|
||||
}
|
||||
return
|
||||
}
|
||||
@ -650,7 +650,7 @@ func (self *httpFrontend) handle_postform(wr http.ResponseWriter, r *http.Reques
|
||||
resp_map["reason"] = err.Error()
|
||||
resp_map["prefix"] = self.prefix
|
||||
resp_map["redirect_url"] = url
|
||||
io.WriteString(wr, template.renderTemplate("post_fail.mustache", resp_map, self.cache.GetHandler().GetI18N(r)))
|
||||
io.WriteString(wr, template.renderTemplate("post_fail", resp_map, self.cache.GetHandler().GetI18N(r)))
|
||||
}
|
||||
}
|
||||
|
||||
@ -664,7 +664,7 @@ func (self *httpFrontend) handle_postform(wr http.ResponseWriter, r *http.Reques
|
||||
if sendJson {
|
||||
json.NewEncoder(wr).Encode(map[string]interface{}{"message_id": nntp.MessageID(), "url": url, "error": nil})
|
||||
} else {
|
||||
template.writeTemplate("post_success.mustache", map[string]interface{}{"prefix": self.prefix, "message_id": nntp.MessageID(), "redirect_url": url}, wr, self.cache.GetHandler().GetI18N(r))
|
||||
template.writeTemplate("post_success", map[string]interface{}{"prefix": self.prefix, "message_id": nntp.MessageID(), "redirect_url": url}, wr, self.cache.GetHandler().GetI18N(r))
|
||||
}
|
||||
}
|
||||
self.handle_postRequest(pr, b, e, s, self.enableBoardCreation)
|
||||
@ -1473,7 +1473,7 @@ func (self *httpFrontend) Mainloop() {
|
||||
m.Path("/live").HandlerFunc(self.handle_liveui).Methods("GET")
|
||||
// live ui page
|
||||
m.Path("/livechan/").HandlerFunc(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
|
||||
template.writeTemplate("live.mustache", map[string]interface{}{"prefix": self.prefix}, w, self.cache.GetHandler().GetI18N(r))
|
||||
template.writeTemplate("live", map[string]interface{}{"prefix": self.prefix}, w, self.cache.GetHandler().GetI18N(r))
|
||||
})).Methods("GET", "HEAD")
|
||||
// live ui api endpoint
|
||||
m.Path("/livechan/api/{meth}").HandlerFunc(self.handle_liveapi).Methods("GET", "POST")
|
||||
|
@ -699,13 +699,13 @@ func (self httpModUI) HandleLogin(wr http.ResponseWriter, r *http.Request) {
|
||||
msg += "invalid key"
|
||||
}
|
||||
}
|
||||
self.writeTemplateParam(wr, r, "modlogin_result.mustache", map[string]interface{}{"message": msg, csrf.TemplateTag: csrf.TemplateField(r)})
|
||||
self.writeTemplateParam(wr, r, "modlogin_result", map[string]interface{}{"message": msg, csrf.TemplateTag: csrf.TemplateField(r)})
|
||||
}
|
||||
|
||||
func (self httpModUI) HandleKeyGen(wr http.ResponseWriter, r *http.Request) {
|
||||
pk, sk := newNaclSignKeypair()
|
||||
tripcode := makeTripcode(pk)
|
||||
self.writeTemplateParam(wr, r, "keygen.mustache", map[string]interface{}{"public": pk, "secret": sk, "tripcode": tripcode})
|
||||
self.writeTemplateParam(wr, r, "keygen", map[string]interface{}{"public": pk, "secret": sk, "tripcode": tripcode})
|
||||
}
|
||||
|
||||
func (self httpModUI) ServeModPage(wr http.ResponseWriter, r *http.Request) {
|
||||
@ -715,15 +715,15 @@ func (self httpModUI) ServeModPage(wr http.ResponseWriter, r *http.Request) {
|
||||
url := r.URL.String()
|
||||
if strings.HasSuffix(url, "/mod/feeds") {
|
||||
// serve feeds page
|
||||
self.writeTemplate(wr, r, "modfeed.mustache")
|
||||
self.writeTemplate(wr, r, "modfeed")
|
||||
} else {
|
||||
// serve mod page
|
||||
self.writeTemplate(wr, r, "modpage.mustache")
|
||||
self.writeTemplate(wr, r, "modpage")
|
||||
}
|
||||
} else {
|
||||
// we are not logged in
|
||||
// serve login page
|
||||
self.writeTemplate(wr, r, "modlogin.mustache")
|
||||
self.writeTemplate(wr, r, "modlogin")
|
||||
}
|
||||
if r.Body != nil {
|
||||
r.Body.Close()
|
||||
|
Reference in New Issue
Block a user