diff options
author | Steve Manuel <nilslice@gmail.com> | 2016-10-29 17:36:47 -0700 |
---|---|---|
committer | Steve Manuel <nilslice@gmail.com> | 2016-10-29 17:36:47 -0700 |
commit | b1212fa6f48da1d539a73e1bd5a0bf6894b97d7d (patch) | |
tree | 43529519307a01aad1006975e3f04cea9c88c273 /system/admin/handlers.go | |
parent | 0be1959e0e19bf77c24ddd49e0ad9ccea0e3b31a (diff) |
adding db procedures and updating handler for external submissions / pending content
Diffstat (limited to 'system/admin/handlers.go')
-rw-r--r-- | system/admin/handlers.go | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 9414fba..181478a 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -642,7 +642,7 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { case "public", "": html += `<div class="row externalable"> - Status: + <span class="description">Status:</span> <span class="active">Public</span> | <a href="` + pendingURL + `">Pending</a> @@ -650,17 +650,21 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { case "pending": html += `<div class="row externalable"> - Status: + <span class="description">Status:</span> <a href="` + publicURL + `">Public</a> | <span class="active">Pending</span> </div>` } + // get _pending posts of type t from the db + posts = db.ContentAll(t + "_pending") + } html += `<ul class="posts row">` - if order == "desc" || order == "" { + switch order { + case "desc", "": // keep natural order of posts slice, as returned from sorted bucket for i := range posts { err := json.Unmarshal(posts[i], &p) @@ -676,7 +680,7 @@ func postsHandler(res http.ResponseWriter, req *http.Request) { b.Write(post) } - } else if order == "asc" { + case "asc": // reverse the order of posts slice for i := len(posts) - 1; i >= 0; i-- { err := json.Unmarshal(posts[i], &p) |