UI tweaks

pull/645/head
Tienson Qin 2020-05-30 12:05:05 +08:00
parent a424d1f429
commit 0fe27e25f4
1 changed files with 14 additions and 10 deletions

View File

@ -667,7 +667,9 @@
(if (seq result)
(->hiccup result (assoc config
:custom-query? true
:group-by-page? true))
:group-by-page? true)
{:style {:margin-top "0.25rem"
:margin-left "0.25rem"}})
[:div "Empty"]))])
(defn block
@ -764,15 +766,17 @@
(:heading/uuid item)))))
(defn ->hiccup
[headings config]
[:div.content
(if (:group-by-page? config)
(for [[page headings] headings]
(let [page (db/entity (:db/id page))]
[:div {:key (str "page-" (:db/id page))}
(page-cp page)
(headings-cp headings config)]))
(headings-cp headings config))])
([headings config]
(->hiccup headings config {}))
([headings config option]
[:div.content option
(if (:group-by-page? config)
(for [[page headings] headings]
(let [page (db/entity (:db/id page))]
[:div {:key (str "page-" (:db/id page))}
(page-cp page)
(headings-cp headings config)]))
(headings-cp headings config))]))
(comment
;; timestamps