balance sheet replacement almost ready.
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -1194,45 +1194,45 @@
|
|||||||
|
|
||||||
(defn table [{:keys [table widths click-event]}]
|
(defn table [{:keys [table widths click-event]}]
|
||||||
(let [cell-count (cell-count table)]
|
(let [cell-count (cell-count table)]
|
||||||
[:div {:style {:height "70vh"
|
(com/content-card {:class "inline-block overflow-hidden"}
|
||||||
:overflow-y "auto"}}
|
[:div { :class "overflow-y-auto h-[70vh] m-4 inline-block"}
|
||||||
(-> [:table {:class "w-full text-sm text-left text-gray-500 dark:text-gray-400"}
|
(-> [:table {:class "text-sm text-left text-gray-500 dark:text-gray-400"}
|
||||||
[:thead {:class "text-xs text-gray-800 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400"}
|
[:thead {:class "text-xs text-gray-800 uppercase bg-gray-50 dark:bg-gray-700 dark:text-gray-400 font-bold"}
|
||||||
(map
|
(map
|
||||||
(fn [header-row header]
|
(fn [header-row header]
|
||||||
(into
|
(into
|
||||||
[:tr {:class " border-b dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}]
|
[:tr {:class " dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}]
|
||||||
(map
|
(map
|
||||||
(fn [w header i]
|
(fn [w header i]
|
||||||
(cell {:width w :click-event click-event
|
(cell {:width w :click-event click-event
|
||||||
:other-style {:position "sticky"
|
:other-style {:position "sticky"
|
||||||
:top (* header-row (+ 22 18))}} header))
|
:top (* header-row (+ 22 18))}} header))
|
||||||
widths
|
widths
|
||||||
header
|
header
|
||||||
(range))))
|
(range))))
|
||||||
(range)
|
(range)
|
||||||
(:header table))]]
|
(:header table))]]
|
||||||
|
|
||||||
(conj
|
(conj
|
||||||
(-> [:tbody {:style {}}]
|
(-> [:tbody {:style {}}]
|
||||||
(into
|
(into
|
||||||
(for [[i row] (map vector (range) (:rows table))]
|
(for [[i row] (map vector (range) (:rows table))]
|
||||||
|
|
||||||
[:tr {:class " border-b dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}
|
[:tr {:class " dark:border-gray-600 hover:bg-gray-100 dark:hover:bg-gray-700"}
|
||||||
(for [[i c] (map vector (range) (take cell-count
|
(for [[i c] (map vector (range) (take cell-count
|
||||||
(reduce
|
(reduce
|
||||||
(fn [[acc cnt] cur]
|
(fn [[acc cnt] cur]
|
||||||
(if (>= (+ cnt (:colspan cur 1)) cell-count)
|
(if (>= (+ cnt (:colspan cur 1)) cell-count)
|
||||||
(reduced (conj acc cur))
|
(reduced (conj acc cur))
|
||||||
[(conj acc cur) (+ cnt (:colspan cur 1))]))
|
[(conj acc cur) (+ cnt (:colspan cur 1))]))
|
||||||
[[] 0]
|
[[] 0]
|
||||||
(concat row (repeat nil)))))]
|
(concat row (repeat nil)))))]
|
||||||
|
|
||||||
(cell {:click-event click-event} c))]))
|
(cell {:click-event click-event} c))]))
|
||||||
(conj [:tr (for [i (range cell-count)]
|
(conj [:tr (for [i (range cell-count)]
|
||||||
|
|
||||||
( cell {:click-event click-event} {:value " "}))])))
|
( cell {:click-event click-event} {:value " "}))])))
|
||||||
)]))
|
)])))
|
||||||
|
|
||||||
(defn concat-tables [tables]
|
(defn concat-tables [tables]
|
||||||
(let [[first & rest] tables]
|
(let [[first & rest] tables]
|
||||||
@@ -1293,18 +1293,18 @@
|
|||||||
|
|
||||||
|
|
||||||
(html-response
|
(html-response
|
||||||
[:div.text-2xl.font-bold.text-gray-600 (format "HELLO %d" client-count)
|
(list
|
||||||
[:div.max-w-screen-2xl
|
[:div.text-2xl.font-bold.text-gray-600 (str "Balance Sheet - " (str/join ", " (map :client/name clients))) ]
|
||||||
(table {:widths (cond-> (into [30 ] (repeat 13 client-count))
|
(table {:widths (cond-> (into [30 ] (repeat 13 client-count))
|
||||||
(:include-comparison args) (into (repeat 13 (* 2 client-count))))
|
(:include-comparison args) (into (repeat 13 (* 2 client-count))))
|
||||||
:click-event ::investigate-clicked
|
:click-event ::investigate-clicked
|
||||||
:table report} )]])))
|
:table report} )))))
|
||||||
|
|
||||||
(defn form [request]
|
(defn form [request]
|
||||||
(fc/start-form
|
(fc/start-form
|
||||||
(:form-params request)
|
(:form-params request)
|
||||||
(:form-errors request)
|
(:form-errors request)
|
||||||
[:div
|
[:div.flex.flex-col.gap-4
|
||||||
[:form {:hx-get (bidi.bidi/path-for ssr-routes/only-routes ::route/run-balance-sheet)
|
[:form {:hx-get (bidi.bidi/path-for ssr-routes/only-routes ::route/run-balance-sheet)
|
||||||
:hx-target "#report"}
|
:hx-target "#report"}
|
||||||
[:div.flex.gap-2
|
[:div.flex.gap-2
|
||||||
@@ -1320,7 +1320,7 @@
|
|||||||
(com/inline-field {:label "Date"} (com/date-input {:placeholder "12/21/2020"
|
(com/inline-field {:label "Date"} (com/date-input {:placeholder "12/21/2020"
|
||||||
:name (fc/field-name)
|
:name (fc/field-name)
|
||||||
:value (fc/field-value)})))
|
:value (fc/field-value)})))
|
||||||
(com/button {:color :primary}
|
(com/button {:color :primary :class "w-16" }
|
||||||
"Run")]]
|
"Run")]]
|
||||||
[:div#report]]))
|
[:div#report]]))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user