diff options
Diffstat (limited to 'system')
-rw-r--r-- | system/admin/handlers.go | 12 | ||||
-rw-r--r-- | system/db/content.go | 10 |
2 files changed, 10 insertions, 12 deletions
diff --git a/system/admin/handlers.go b/system/admin/handlers.go index 1e6a26c..fed77f7 100644 --- a/system/admin/handlers.go +++ b/system/admin/handlers.go @@ -1048,10 +1048,10 @@ func contentsHandler(res http.ResponseWriter, req *http.Request) { // p is the asserted post as an Editable, t is the Type of the post. // specifier is passed to append a name to a namespace like __pending func adminPostListItem(e editor.Editable, typeName, status string) []byte { - s, ok := e.(editor.Sortable) + s, ok := e.(content.Sortable) if !ok { - log.Println("Content type", typeName, "doesn't implement editor.Sortable") - post := `<li class="col s12">Error retreiving data. Your data type doesn't implement necessary interfaces. (editor.Sortable)</li>` + log.Println("Content type", typeName, "doesn't implement content.Sortable") + post := `<li class="col s12">Error retreiving data. Your data type doesn't implement necessary interfaces. (content.Sortable)</li>` return []byte(post) } @@ -1312,12 +1312,12 @@ func editHandler(res http.ResponseWriter, req *http.Request) { return } } else { - s, ok := post.(content.Identifiable) + item, ok := post.(content.Identifiable) if !ok { - log.Println("Content type", t, "doesn't implement editor.Identifiable") + log.Println("Content type", t, "doesn't implement content.Identifiable") return } - s.SetItemID(-1) + item.SetItemID(-1) } m, err := manager.Manage(post.(editor.Editable), t) diff --git a/system/db/content.go b/system/db/content.go index 87b3e69..3293ff4 100644 --- a/system/db/content.go +++ b/system/db/content.go @@ -11,8 +11,6 @@ import ( "strings" "github.com/bosssauce/ponzu/content" - "github.com/bosssauce/ponzu/management/editor" - "github.com/bosssauce/ponzu/management/manager" "github.com/boltdb/bolt" "github.com/gorilla/schema" @@ -305,7 +303,7 @@ func Query(namespace string, opts QueryOptions) (int, [][]byte) { // correct bad input rather than return nil or error // similar to default case for opts.Order switch below if opts.Count < 0 { - opts.Count = 0 + opts.Count = -1 } if opts.Offset < 0 { @@ -428,7 +426,7 @@ func SortContent(namespace string) { return } - posts = append(posts, post.(editor.Sortable)) + posts = append(posts, post.(content.Sortable)) } // sort posts @@ -469,7 +467,7 @@ func SortContent(namespace string) { } -type sortableContent []editor.Sortable +type sortableContent []content.Sortable func (s sortableContent) Len() int { return len(s) @@ -502,7 +500,7 @@ func postToJSON(ns string, data url.Values) ([]byte, error) { // if the content has no slug, and has no specifier, create a slug, check it // for duplicates, and add it to our values if data.Get("slug") == "" && data.Get("__specifier") == "" { - slug, err := manager.Slug(post.(content.Identifiable)) + slug, err := content.Slug(post.(content.Identifiable)) if err != nil { return nil, err } |