From 115b19e06a81543d7d5ff340f9f054e0692b6d1e Mon Sep 17 00:00:00 2001 From: Steve Manuel Date: Tue, 6 Dec 2016 12:51:57 -0800 Subject: adding content search for both public and pending specifiers --- system/admin/handlers.go | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 7ea018c..b25457a 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -866,6 +866,7 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { search + ` @@ -1627,13 +1628,19 @@ func searchHandler(res http.ResponseWriter, req *http.Request) { q := req.URL.Query() t := q.Get("type") search := q.Get("q") + status := q.Get("status") + var specifier string if t == "" || search == "" { http.Redirect(res, req, req.URL.Scheme+req.URL.Host+"/admin", http.StatusFound) return } - posts := db.ContentAll(t) + if status == "pending" { + specifier = "_" + status + } + + posts := db.ContentAll(t + specifier) b := &bytes.Buffer{} p := content.Types[t]().(editor.Editable) @@ -1641,11 +1648,13 @@ func searchHandler(res http.ResponseWriter, req *http.Request) {
` + t + ` Results
-
+
+ search - + +
-- cgit v1.2.3