Albirew/nyaa-pantsu
Archivé
1
0
Bifurcation 0
Cette révision appartient à :
kipukun 2017-05-05 09:34:03 -04:00
révision ddb6560baf

Voir le fichier

@ -82,6 +82,7 @@ func apiViewHandler(w http.ResponseWriter, r *http.Request) {
func searchHandler(w http.ResponseWriter, r *http.Request) {
var templates = template.Must(template.New("home").Funcs(funcMap).ParseFiles("templates/index.html", "templates/home.html"))
templates.ParseGlob("templates/_*.html") // common
vars := mux.Vars(r)
page := vars["page"]
@ -174,6 +175,7 @@ func searchByQuery(r *http.Request, pagenum int) (SearchParam, []model.Torrents,
func faqHandler(w http.ResponseWriter, r *http.Request) {
var templates = template.Must(template.New("FAQ").Funcs(funcMap).ParseFiles("templates/index.html", "templates/FAQ.html"))
templates.ParseGlob("templates/_*.html") // common
err := templates.ExecuteTemplate(w, "index.html", FaqTemplateVariables{Navigation{}, NewSearchForm(), r.URL, mux.CurrentRoute(r)})
if err != nil {
http.Error(w, err.Error(), http.StatusInternalServerError)
@ -220,6 +222,7 @@ func rssHandler(w http.ResponseWriter, r *http.Request) {
func viewHandler(w http.ResponseWriter, r *http.Request) {
var templates = template.Must(template.ParseFiles("templates/index.html", "templates/view.html"))
templates.ParseGlob("templates/_*.html") // common
vars := mux.Vars(r)
id := vars["id"]
@ -235,8 +238,9 @@ func viewHandler(w http.ResponseWriter, r *http.Request) {
}
func rootHandler(w http.ResponseWriter, r *http.Request) {
var templates = template.Must(template.New("home").Funcs(funcMap).ParseFiles("templates/index.html", "templates/home.html"))
vars := mux.Vars(r)
var templates = template.Must(template.New("home").Funcs(funcMap).ParseFiles("templates/index.html", "templates/home.html"))
templates.ParseGlob("templates/_*.html") // common
vars := mux.Vars(r)
page := vars["page"]
// db params url