forked from jason/cpolis
Add profile pic and correct usage of banner link
This commit is contained in:
@@ -9,7 +9,7 @@ import (
|
||||
b "streifling.com/jason/cpolis/cmd/backend"
|
||||
)
|
||||
|
||||
func UploadImage(c *b.Config, s *b.CookieStore) http.HandlerFunc {
|
||||
func UploadEasyMDEImage(c *b.Config, s *b.CookieStore) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := GetSession(w, r, c, s); err != nil {
|
||||
log.Println(err)
|
||||
@@ -42,7 +42,7 @@ func UploadImage(c *b.Config, s *b.CookieStore) http.HandlerFunc {
|
||||
}
|
||||
}
|
||||
|
||||
func UploadBanner(c *b.Config, s *b.CookieStore, fileKey, htmlFile, htmlTemplate string) http.HandlerFunc {
|
||||
func UploadImage(c *b.Config, s *b.CookieStore, fileKey, htmlFile, htmlTemplate string) http.HandlerFunc {
|
||||
return func(w http.ResponseWriter, r *http.Request) {
|
||||
if _, err := GetSession(w, r, c, s); err != nil {
|
||||
log.Println(err)
|
||||
@@ -69,8 +69,8 @@ func UploadBanner(c *b.Config, s *b.CookieStore, fileKey, htmlFile, htmlTemplate
|
||||
return
|
||||
}
|
||||
|
||||
data := new(struct{ BannerImage string })
|
||||
data.BannerImage = filename
|
||||
data := new(struct{ Image string })
|
||||
data.Image = filename
|
||||
|
||||
tmpl, err := template.ParseFiles(c.WebDir + "/templates/" + htmlFile)
|
||||
if err = template.Must(tmpl, err).ExecuteTemplate(w, htmlTemplate, data); err != nil {
|
||||
|
Reference in New Issue
Block a user