not neeed urldecode also dropping titles/notes
This commit is contained in:
parent
2a13a49474
commit
e75c81fa36
|
@ -15,7 +15,6 @@ import (
|
||||||
"github.com/dballard/transmet/news"
|
"github.com/dballard/transmet/news"
|
||||||
"bytes"
|
"bytes"
|
||||||
txtTemplate "text/template"
|
txtTemplate "text/template"
|
||||||
"net/url"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetFlashes(session *sessions.Session) map[string]interface{} {
|
func GetFlashes(session *sessions.Session) map[string]interface{} {
|
||||||
|
@ -151,7 +150,6 @@ func addFormHandler(w http.ResponseWriter, r *http.Request, user *user.User) {
|
||||||
session.Save(r, w)
|
session.Save(r, w)
|
||||||
|
|
||||||
if link != nil {
|
if link != nil {
|
||||||
fmt.Println("link: '" + link.(string) + "'")
|
|
||||||
//TODO category_id
|
//TODO category_id
|
||||||
ShowTemplate("add", w, map[string]interface{}{"user": user, "flashes": flashes, "categories": categories.CategoriesTree, "link": link, "title": title, "description": description, "popup": popup})
|
ShowTemplate("add", w, map[string]interface{}{"user": user, "flashes": flashes, "categories": categories.CategoriesTree, "link": link, "title": title, "description": description, "popup": popup})
|
||||||
return
|
return
|
||||||
|
@ -177,8 +175,8 @@ func addPostHandler(w http.ResponseWriter, r *http.Request, user *user.User) {
|
||||||
session, _ := store.Get(r, "c_user")
|
session, _ := store.Get(r, "c_user")
|
||||||
var news news.News
|
var news news.News
|
||||||
|
|
||||||
news.Title, _ = url.QueryUnescape(r.FormValue("title"))
|
news.Title = r.FormValue("title")
|
||||||
news.Notes, _ = url.QueryUnescape(r.FormValue("notes"))
|
news.Notes = r.FormValue("notes")
|
||||||
news.Url = r.FormValue("link")
|
news.Url = r.FormValue("link")
|
||||||
popup := r.FormValue("popup")
|
popup := r.FormValue("popup")
|
||||||
category_id, err := strconv.Atoi(r.FormValue("category"))
|
category_id, err := strconv.Atoi(r.FormValue("category"))
|
||||||
|
|
Loading…
Reference in New Issue