Fixes logout link.

This commit is contained in:
2023-01-17 16:02:45 -08:00
parent 89fa510375
commit d6abad581b
5 changed files with 51 additions and 5 deletions

View File

@@ -302,10 +302,20 @@
(defn vendor-table [request]
(html-response (table request)))
(defn page [{:keys [identity matched-route] :as request}] (defn page [{:keys [identity matched-route] :as request}]
(base-page (base-page
[:div [:div
(table request)] [:div#vendor-table {:hx-get (bidi/path-for ssr-routes/only-routes
:company-1099-vendor-table
:request-method :get)
:hx-trigger "load"
:hx-swap "outerHTML"}
[:div.container
[:div.column.is-4.is-offset-4.has-text-centered
[:div.loader.is-loading.is-active.big.is-centered]]]]]
[:div [:div
(company-side-bar matched-route)])) (company-side-bar matched-route)]))

View File

@@ -10,6 +10,7 @@
:admin-history-search (wrap-client-redirect-unauthenticated (wrap-secure (wrap-admin admin/history-search))) :admin-history-search (wrap-client-redirect-unauthenticated (wrap-secure (wrap-admin admin/history-search)))
:admin-history-inspect (wrap-client-redirect-unauthenticated (wrap-secure (wrap-admin admin/inspect))) :admin-history-inspect (wrap-client-redirect-unauthenticated (wrap-secure (wrap-admin admin/inspect)))
:company-1099 (wrap-client-redirect-unauthenticated (wrap-secure company-1099/page)) :company-1099 (wrap-client-redirect-unauthenticated (wrap-secure company-1099/page))
:company-1099-vendor-table (wrap-client-redirect-unauthenticated (wrap-secure company-1099/vendor-table))
:company-1099-vendor-dialog (wrap-client-redirect-unauthenticated (wrap-secure company-1099/vendor-dialog)) :company-1099-vendor-dialog (wrap-client-redirect-unauthenticated (wrap-secure company-1099/vendor-dialog))
:company-1099-vendor-save (wrap-client-redirect-unauthenticated (wrap-secure company-1099/vendor-save))}) :company-1099-vendor-save (wrap-client-redirect-unauthenticated (wrap-secure company-1099/vendor-save))})

View File

@@ -12,6 +12,39 @@
(hiccup/html (hiccup/html
{} {}
hiccup))}) hiccup))})
(defn client-dropdown []
(let [client nil
matching-clients nil]
[:div#company-dropdown.navbar-item.has-dropdown
[:a.navbar-link {"_" (hiccup/raw "on click toggle .is-active on <#company-dropdown />")} "Company"]
[:div.navbar-dropdown
[:input.input.navbar-item {:placeholder "Company name"
:autoFocus true} ]
]]
#_[navbar-drop-down {:header (str "Company: " (if @client (:name @client)
"All"))
:id :select-client}
[:div
[:a {:class "navbar-item"
:on-click (fn []
(re-frame/dispatch [:events/toggle-menu :select-client])
(re-frame/dispatch [:forms/form-closing :client-search])
(re-frame/dispatch [:events/swap-client nil]))} "All" ]
[:hr {:class "navbar-divider"}]
[form-builder/builder {:id :client-search
:submit-event [:client-searched]}
[form-builder/raw-field-v2 {:field :value}
[:input.input.navbar-item {:placeholder "Company name"
:auto-focus true}]]]
(for [{:keys [name id] :as client} (take 8 matching-clients)]
^{:key id }
[:a {:class "navbar-item"
:on-click (fn []
(re-frame/dispatch [:events/toggle-menu :select-client])
(re-frame/dispatch [:events/swap-client client]))
} name])]]))
(defn base-page [contents side-bar-contents] (defn base-page [contents side-bar-contents]
(html-page (html-page
@@ -59,9 +92,9 @@
"POS" ] "POS" ]
[:a.navbar-item {:href "/transactions/"} [:a.navbar-item {:href "/transactions/"}
"Transactions" ] "Transactions" ]
[:a.navbar-item {:href "/ledger/"} [:a.navbar-item {:href "/ledger/"}
"Ledger" ]]]]] "Ledger" ]
(client-dropdown)]]]]
[:div {:class "columns has-shadow", :id "mail-app", :style "margin-bottom: 0px; height: calc(100vh - 46px);"} [:div {:class "columns has-shadow", :id "mail-app", :style "margin-bottom: 0px; height: calc(100vh - 46px);"}
[:aside {:class "column aside menu is-2 "} [:aside {:class "column aside menu is-2 "}
[:div {:class "main left-nav"} [:div {:class "main left-nav"}

View File

@@ -1,7 +1,8 @@
(ns auto-ap.client-routes) (ns auto-ap.client-routes)
(def routes ["/" {"" :index (def routes ["/" {"" :index
#"login/?" :login "login" :login
"login/" :login
"needs-activation/" :needs-activation "needs-activation/" :needs-activation
"needs-activation" :needs-activation "needs-activation" :needs-activation
"payments/" :payments "payments/" :payments

View File

@@ -6,6 +6,7 @@
["/" [#"\d+" :entity-id] #"/?"] :admin-history-search ["/" [#"\d+" :entity-id] #"/?"] :admin-history-search
["/inspect/" [#"\d+" :entity-id] #"/?"] :admin-history-inspect}} ["/inspect/" [#"\d+" :entity-id] #"/?"] :admin-history-inspect}}
"company" {"/1099" :company-1099 "company" {"/1099" :company-1099
"/1099/table" {:get :company-1099-vendor-table}
"/1099/vendor-dialog" {["/" [#"\d+" :vendor-id]] {:get :company-1099-vendor-dialog "/1099/vendor-dialog" {["/" [#"\d+" :vendor-id]] {:get :company-1099-vendor-dialog
:post :company-1099-vendor-save}}}}) :post :company-1099-vendor-save}}}})