Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Ce dépôt a été archivé le 2022-05-07. Vous pouvez voir ses fichiers ou le cloner, mais pas ouvrir de ticket ou de demandes d'ajout, ni soumettre de changements.
nyaa-pantsu/router/userHandler.go
akuma06 f88b4656a1 Fixed Typo + Added multi language support
Multi language for User package
2017-05-07 02:32:32 +02:00

60 lignes
1,7 Kio
Go

package router
import(
"html/template"
"net/http"
"github.com/ewhal/nyaa/templates"
"github.com/ewhal/nyaa/service/user/form"
"github.com/ewhal/nyaa/util/modelHelper"
"github.com/ewhal/nyaa/util/languages"
"github.com/gorilla/mux"
)
var viewRegisterTemplate = template.Must(template.New("userRegister").Funcs(FuncMap).ParseFiles("templates/index.html", "templates/user/register.html"))
//var viewTemplate = template.Must(template.New("view").Funcs(FuncMap).ParseFiles("templates/index.html", "templates/view.html"))
//var viewTemplate = template.Must(template.New("view").Funcs(FuncMap).ParseFiles("templates/index.html", "templates/view.html"))
// Getting View User Registration
func UserRegisterFormHandler(w http.ResponseWriter, r *http.Request) {
b := form.RegistrationForm{}
modelHelper.BindValueForm(&b, r)
languages.SetTranslation("en-us", viewRegisterTemplate)
htv := UserRegisterTemplateVariables{b, templates.NewSearchForm(), templates.Navigation{}, r.URL, mux.CurrentRoute(r)}
err := viewRegisterTemplate.ExecuteTemplate(w, "index.html", htv)
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
}
}
// Getting View User Login
func UserLoginFormHandler(w http.ResponseWriter, r *http.Request) {
}
// Getting User Profile
func UserProfileHandler(w http.ResponseWriter, r *http.Request) {
}
// Getting View User Profile Update
func UserProfileFormHandler(w http.ResponseWriter, r *http.Request) {
}
// Post Registration controller
func UserRegisterPostHandler(w http.ResponseWriter, r *http.Request) {
}
// Post Login controller
func UserLoginPostHandler(w http.ResponseWriter, r *http.Request) {
}
// Post Profule Update controller
func UserProfilePostHandler(w http.ResponseWriter, r *http.Request) {
}