Makes reports page work with new tailwind

This commit is contained in:
2023-05-12 15:17:54 -07:00
parent e78c73e093
commit 8dca622947
13 changed files with 540 additions and 296 deletions

View File

@@ -12,14 +12,14 @@
(defn dropdown-search-results* [{:keys [options]}]
[:ul
(for [option options]
(for [[id company-name]options]
[:li
[:div {:class "flex items-center pl-2 rounded hover:bg-green-100 dark:hover:bg-green-600"}
[:a {:href "#" :class "w-full py-2 ml-2 text-sm font-medium text-gray-900 rounded dark:text-gray-300"
"_" (hiccup/raw "on click set value of <#company-search-value/> to @data-value then send selected to #company-dropdown")
:data-value (get option "key")}
(get option "value")]]])])
:data-value id}
company-name]]])])
(defn get-clients [identity query]
(dc/q '[:find ?c ?n
@@ -33,10 +33,7 @@
(defn dropdown-search-results [{:keys [identity] :as request}]
(html-response
(dropdown-search-results* {:options (->> (get-clients identity (get (:query-params request) "search-text"))
(map (fn [[k v]]
{"key" k
"value" v})))
(dropdown-search-results* {:options (get-clients identity (get (:query-params request) "search-text"))
:client (:client (:session request))})))
(defn dropdown [{:keys [client]}]
@@ -79,14 +76,7 @@
:hx-target "#company-search-results"
:hx-swap "innerHTML"} ]]
[:input#company-search-value {:type "hidden"
:autocomplete "off"
:name "search-client"
:hx-put (bidi/path-for ssr-routes/only-routes
:active-client
:request-method :put)
:hx-target "#company-dropdown"
:hx-swap "outerHTML"
:hx-trigger "change changed"} ]]
:name "search-client"}]]
[:div.divide-y.divide-gray-100
[:div#company-search-results {:class "h-48 px-3 pb-3 overflow-y-auto text-sm text-gray-700 dark:text-gray-200"}]
[:div {:class "flex items-center pl-2 rounded hover:bg-green-100 dark:hover:bg-green-600"}