; Blog app defpage declarations
; Pages kept as Python: home, index, post-detail (cache_page / complex branching)

; --- New post/page editors ---

(defpage new-post
  :path "/new/"
  :auth :admin
  :layout :blog
  :content (editor-content))

(defpage new-page
  :path "/new-page/"
  :auth :admin
  :layout :blog
  :content (editor-page-content))

; --- Post admin pages (nested under /<slug>/admin/) ---

(defpage post-admin
  :path "/"
  :auth :admin
  :layout (:post-admin :selected "admin")
  :content (post-admin-content))

(defpage post-data
  :path "/data/"
  :auth :admin
  :layout (:post-admin :selected "data")
  :content (post-data-content))

(defpage post-preview
  :path "/preview/"
  :auth :admin
  :layout (:post-admin :selected "preview")
  :content (post-preview-content))

(defpage post-entries
  :path "/entries/"
  :auth :admin
  :layout (:post-admin :selected "entries")
  :content (post-entries-content))

(defpage post-settings
  :path "/settings/"
  :auth :post_author
  :layout (:post-admin :selected "settings")
  :content (post-settings-content))

(defpage post-edit
  :path "/edit/"
  :auth :post_author
  :layout (:post-admin :selected "edit")
  :content (post-edit-content))

; --- Settings pages ---

(defpage settings-home
  :path "/"
  :auth :admin
  :layout :blog-settings
  :content (settings-content))

(defpage cache-page
  :path "/cache/"
  :auth :admin
  :layout :blog-cache
  :content (cache-content))

; --- Snippets ---

(defpage snippets-page
  :path "/"
  :auth :login
  :layout :blog-snippets
  :content (snippets-content))

; --- Menu Items ---

(defpage menu-items-page
  :path "/"
  :auth :admin
  :layout :blog-menu-items
  :content (menu-items-content))

; --- Tag Groups ---

(defpage tag-groups-page
  :path "/"
  :auth :admin
  :layout :blog-tag-groups
  :content (tag-groups-content))

(defpage tag-group-edit
  :path "/<int:id>/"
  :auth :admin
  :layout :blog-tag-group-edit
  :content (tag-group-edit-content))
