Fixed unpublish issue

This commit is contained in:
Tienson Qin
2020-07-23 18:16:24 +08:00
parent 358227d9ea
commit df4cc38e06
3 changed files with 22 additions and 19 deletions

View File

@@ -57,22 +57,23 @@
today? (= (string/lower-case title)
(string/lower-case (date/journal-name)))]
[:div.flex-1
[:a.initial-color {:href (str "/page/" encoded-page-name)
:on-click (fn [e]
(util/stop e)
(when (gobj/get e "shiftKey")
(when-let [page (db/pull [:page/name title])]
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id page)
:page
{:page page
:journal? true}))
(handler/show-right-sidebar)))}
[:h1.title
(util/capitalize-all title)]]
(ui/foldable
[:a.initial-color {:href (str "/page/" encoded-page-name)
:on-click (fn [e]
(util/stop e)
(when (gobj/get e "shiftKey")
(when-let [page (db/pull [:page/name title])]
(state/sidebar-add-block!
(state/get-current-repo)
(:db/id page)
:page
{:page page
:journal? true}))
(handler/show-right-sidebar)))}
[:h1.title
(util/capitalize-all title)]]
(headings-cp repo page encoded-page-name format)
(headings-cp repo page encoded-page-name format))
(page/today-queries repo today? false)

View File

@@ -63,4 +63,5 @@
:group-by-page? true}
{})]
(content/content encoded-page-name
{:hiccup ref-hiccup})))]))))
{:hiccup ref-hiccup}))
true)]))))

View File

@@ -160,9 +160,10 @@
[page-name]
(page-add-directives! page-name {"published" false})
(let [directives (db/get-page-directives page-name)
permalink (:permalink directives)]
(if permalink
(util/delete (str config/api "pages/" permalink)
permalink (:permalink directives)
project (state/get-current-project)]
(if (and project permalink)
(util/delete (str config/api project "/" permalink)
(unpublished-success-handler page-name)
unpublished-failed-handler)
(handler/show-notification!