preliminary investigate
This commit is contained in:
@@ -30,6 +30,7 @@
|
||||
[clojure.string :as str]
|
||||
[config.core :refer [env] :as env]
|
||||
[datomic.api :as dc]
|
||||
[hiccup.util :as hu]
|
||||
[iol-ion.utils :refer [by]]
|
||||
[malli.core :as mc])
|
||||
(:import [java.util UUID]
|
||||
@@ -87,7 +88,7 @@
|
||||
|
||||
|
||||
|
||||
(defn cell [{:keys [width click-event other-style]} c]
|
||||
(defn cell [{:keys [width investigate-url other-style]} c]
|
||||
(let [cell-contents (cond
|
||||
|
||||
(= :dollar (:format c))
|
||||
@@ -104,8 +105,9 @@
|
||||
:else
|
||||
(str (:value c)))
|
||||
cell-contents (if (:filters c)
|
||||
[:a #_{:on-click (dispatch-event [click-event (:filters c)])}
|
||||
cell-contents]
|
||||
(com/link {:hx-get (hu/url investigate-url
|
||||
(update (:filters c) :numeric-code (fn [nc] (into [] nc))))}
|
||||
cell-contents)
|
||||
cell-contents)]
|
||||
[:td.px-4.py-2
|
||||
(cond-> {:style (cond-> {:width (str width "em")}
|
||||
@@ -141,7 +143,7 @@
|
||||
(apply max counts)
|
||||
0)))
|
||||
|
||||
(defn table [{:keys [table widths click-event]}]
|
||||
(defn table [{:keys [table widths investigate-url]}]
|
||||
(let [cell-count (cell-count table)]
|
||||
(com/content-card {:class "inline-block overflow-hidden"}
|
||||
[:div { :class "overflow-y-auto h-[70vh] m-4 inline-block"}
|
||||
@@ -153,7 +155,8 @@
|
||||
[:tr {:class " dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}]
|
||||
(map
|
||||
(fn [w header i]
|
||||
(cell {:width w :click-event click-event
|
||||
(cell {:width w
|
||||
:investigate-url investigate-url
|
||||
:other-style {:position "sticky"
|
||||
:top (* header-row (+ 22 18))}} header))
|
||||
widths
|
||||
@@ -177,10 +180,10 @@
|
||||
[[] 0]
|
||||
(concat row (repeat nil)))))]
|
||||
|
||||
(cell {:click-event click-event} c))]))
|
||||
(cell {:investigate-url investigate-url} c))]))
|
||||
(conj [:tr (for [i (range cell-count)]
|
||||
|
||||
( cell {:click-event click-event} {:value " "}))])))
|
||||
( cell {:investigate-url investigate-url} {:value " "}))])))
|
||||
)])))
|
||||
|
||||
(defn concat-tables [tables]
|
||||
@@ -280,7 +283,7 @@
|
||||
[:div.text-2xl.font-bold.text-gray-600 (str "Balance Sheet - " (str/join ", " (map :client/name client))) ]
|
||||
(table {:widths (cond-> (into [30 ] (repeat 13 client-count))
|
||||
(:include-comparison (:args data)) (into (repeat 13 (* 2 client-count))))
|
||||
:click-event ::investigate-clicked
|
||||
:investigate-url (bidi.bidi/path-for ssr-routes/only-routes ::route/investigate)
|
||||
:table report} ))))])
|
||||
|
||||
(defn form* [request]
|
||||
|
||||
Reference in New Issue
Block a user