diff options
author | Steve Manuel <nilslice@gmail.com> | 2017-01-04 11:29:02 -0800 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2017-01-04 11:29:02 -0800 |
commit | 2238d79b896619872939a2f5b5d53ad862bc705a (patch) | |
tree | 4ff7a5e48d2ee98cde2c9eb992156ac78a502558 | |
parent | 349a2cf78631d60da582b8d776d11962505ca8bd (diff) |
testing fix for order mismatch in admin
-rw-r--r-- | system/admin/handlers.go | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 0fb025c..32d160a 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -858,8 +858,9 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { specifier = "__pending" } - total, posts := db.Query(t+specifier, opts) b := &bytes.Buffer{} + var total int + var posts [][]byte html := `<div class="col s9 card"> <div class="card-content"> @@ -922,6 +923,9 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { switch status { case "public", "": + // get __sorted posts of type t from the db + total, posts = db.Query(t+specifier, opts) + html += `<div class="row externalable"> <span class="description">Status:</span> <span class="active">Public</span> @@ -945,7 +949,7 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { case "pending": // get __pending posts of type t from the db - _, posts = db.Query(t+"__pending", opts) + total, posts = db.Query(t+"__pending", opts) html += `<div class="row externalable"> <span class="description">Status:</span> @@ -970,6 +974,8 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { } } else { + total, posts = db.Query(t+specifier, opts) + for i := range posts { err := json.Unmarshal(posts[i], &p) if err != nil { |