From 17bf0b7f04e599e1da010b7312141650a5d21bc7 Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Sat, 29 Oct 2016 20:15:06 -0700 Subject: testing fix for _pending content retrieval --- system/admin/handlers.go | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 94ce74b..314ecba 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -677,7 +677,7 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { continue } - post := adminPostListItem(p, t) + post := adminPostListItem(p, t, "_pending") b.Write(post) } } else { @@ -692,7 +692,7 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { continue } - post := adminPostListItem(p, t) + post := adminPostListItem(p, t, "") b.Write(post) } } @@ -710,7 +710,7 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { continue } - post := adminPostListItem(p, t) + post := adminPostListItem(p, t, "_pending") b.Write(post) } } else { @@ -725,7 +725,7 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { continue } - post := adminPostListItem(p, t) + post := adminPostListItem(p, t, "") b.Write(post) } } @@ -762,7 +762,8 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { // adminPostListItem is a helper to create the li containing a post. // p is the asserted post as an Editable, t is the Type of the post. -func adminPostListItem(p editor.Editable, t string) []byte { +// specifier is passed to append a name to a namespace like _pending +func adminPostListItem(p editor.Editable, t, specifier string) []byte { s, ok := p.(editor.Sortable) if !ok { log.Println("Content type", t, "doesn't implement editor.Sortable") @@ -780,14 +781,14 @@ func adminPostListItem(p editor.Editable, t string) []byte { post := `
  • - ` + p.ContentName() + ` + ` + p.ContentName() + ` Updated: ` + updatedTime + ` ` + publishTime + `
    Delete - +
  • ` @@ -817,7 +818,7 @@ func editHandler(res http.ResponseWriter, req *http.Request) { if status == "pending" { t = t + "_pending" } - fmt.Println(t, i, status) + data, err := db.Content(t + ":" + i) if err != nil { log.Println(err) -- cgit v1.2.3