diff options
-rw-r--r-- | system/admin/handlers.go | 7 | ||||
-rw-r--r-- | system/db/content.go | 4 |
2 files changed, 8 insertions, 3 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index d04adec..c2d67e9 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -941,8 +941,13 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { var path = window.location.pathname; var s = sort.val(); var t = getParam('type'); + var status = getParam('status'); - window.location.replace(path + '?type=' + t + '&order=' + s) + if (status == "") { + status = "public"; + } + + window.location.replace(path + '?type=' + t + '&order=' + s + '&status=' + status); }); var order = getParam('order'); diff --git a/system/db/content.go b/system/db/content.go index 3e6e5a4..4de9342 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -570,9 +570,9 @@ func SortContent(namespace string) { return err } - // encode to json and store as 'i:post.Time()':post + // encode to json and store as 'post.Time():i':post for i := range bb { - cid := fmt.Sprintf("%d", posts[i].Time()) + cid := fmt.Sprintf("%d:%d", posts[i].Time(), i) err = b.Put([]byte(cid), bb[i]) if err != nil { return err |