feature/id-for-hmtl-headers #3
@@ -16,6 +16,12 @@ import (
 | 
			
		||||
	b "streifling.com/jason/cpolis/cmd/backend"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
type ArticlePreviewHtmlData struct {
 | 
			
		||||
	Title       string
 | 
			
		||||
	Description string
 | 
			
		||||
	Content     template.HTML
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func ShowHub(c *b.Config, db *b.DB, s *b.CookieStore) http.HandlerFunc {
 | 
			
		||||
	return func(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
		session, err := s.Get(r, "cookie")
 | 
			
		||||
@@ -442,14 +448,8 @@ func UploadImage(c *b.Config) http.HandlerFunc {
 | 
			
		||||
 | 
			
		||||
func PreviewArticle(c *b.Config, s *b.CookieStore) http.HandlerFunc {
 | 
			
		||||
	return func(w http.ResponseWriter, r *http.Request) {
 | 
			
		||||
		type htmlData struct {
 | 
			
		||||
			Title       string
 | 
			
		||||
			Description string
 | 
			
		||||
			Content     template.HTML
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		var err error
 | 
			
		||||
		data := new(htmlData)
 | 
			
		||||
		data := new(ArticlePreviewHtmlData)
 | 
			
		||||
 | 
			
		||||
		data.Title, err = b.ConvertToPlain(r.PostFormValue("article-title"))
 | 
			
		||||
		if err != nil {
 | 
			
		||||
 
 | 
			
		||||
@@ -12,6 +12,7 @@ import (
 | 
			
		||||
 | 
			
		||||
func init() {
 | 
			
		||||
	gob.Register(b.User{})
 | 
			
		||||
	gob.Register(f.ArticlePreviewHtmlData{})
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func main() {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user