From 802945384b44910b675d81420bb5eaf7c6c69a95 Mon Sep 17 00:00:00 2001 From: akuma06 Date: Thu, 11 May 2017 00:02:36 +0200 Subject: [PATCH] Fixes --- router/modpanel.go | 4 ++-- router/templateVariables.go | 1 + templates/admin/paneltorrentedit.html | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/router/modpanel.go b/router/modpanel.go index 8bce22ed..f3404bed 100644 --- a/router/modpanel.go +++ b/router/modpanel.go @@ -200,7 +200,7 @@ func TorrentEditModPanel(w http.ResponseWriter, r *http.Request) { uploadForm.Magnet = string(torrentJson.Magnet) uploadForm.Status = torrentJson.Status uploadForm.Description = string(torrentJson.Description) - htv := PanelTorrentEdVbs{uploadForm, NewSearchForm(), currentUser, form.NewErrors(), form.NewInfos()} + htv := PanelTorrentEdVbs{uploadForm, NewSearchForm(), currentUser, form.NewErrors(), form.NewInfos(), r.URL} err := panelTorrentEd.ExecuteTemplate(w, "admin_index.html", htv) log.CheckError(err) @@ -242,7 +242,7 @@ func TorrentPostEditModPanel(w http.ResponseWriter, r *http.Request) { } } languages.SetTranslationFromRequest(panelTorrentEd, r, "en-us") - htv := PanelTorrentEdVbs{uploadForm, NewSearchForm(), currentUser, err, infos} + htv := PanelTorrentEdVbs{uploadForm, NewSearchForm(), currentUser, err, infos, r.URL} _ = panelTorrentEd.ExecuteTemplate(w, "admin_index.html", htv) } else { http.Error(w, "admins only", http.StatusForbidden) diff --git a/router/templateVariables.go b/router/templateVariables.go index c3cc2010..3090d942 100644 --- a/router/templateVariables.go +++ b/router/templateVariables.go @@ -153,6 +153,7 @@ type PanelTorrentEdVbs struct { User *model.User FormInfos map[string][]string FormErrors map[string][]string + URL *url.URL // For parsing Url in templates } type PanelTorrentReportListVbs struct { diff --git a/templates/admin/paneltorrentedit.html b/templates/admin/paneltorrentedit.html index c85015e6..e4a38ee8 100644 --- a/templates/admin/paneltorrentedit.html +++ b/templates/admin/paneltorrentedit.html @@ -1,3 +1,4 @@ +{{define "title"}}Torrent Edit Panel{{end}} {{define "content"}} {{with .Upload}}