a little ux
This commit is contained in:
@@ -32,8 +32,7 @@
|
||||
:paramName "file"
|
||||
:url "/pdf-upload"
|
||||
:previewsContainer "#dz-hidden"
|
||||
:previewTemplate "<div class='dz-hidden-preview'></div>"
|
||||
})))}))
|
||||
:previewTemplate "<div class='dz-hidden-preview'></div>"})))}))
|
||||
|
||||
(defmulti active-page identity)
|
||||
|
||||
@@ -49,25 +48,29 @@
|
||||
(defmethod active-page :unpaid-invoices []
|
||||
[(with-meta
|
||||
(fn []
|
||||
(let [invoices (re-frame/subscribe [::subs/unpaid-invoices])]
|
||||
|
||||
(let [invoices (re-frame/subscribe [::subs/unpaid-invoices])
|
||||
status (re-frame/subscribe [::subs/status])]
|
||||
[:div {:class "inbox-messages"}
|
||||
[:h1.title "Unpaid invoices"]
|
||||
[:table {:class "table", :style {:width "100%"}}
|
||||
[:thead
|
||||
[:tr
|
||||
[:th "Customer"]
|
||||
[:th "Invoice #"]
|
||||
[:th "Date"]
|
||||
[:th "Amount"]]]
|
||||
[:tbody (for [{:keys [customer-identifier invoice-number date total id] :as i} @invoices]
|
||||
^{:key (str customer-identifier "-" invoice-number "-" date "-" total "-" id)}
|
||||
[:tr
|
||||
[:td customer-identifier]
|
||||
[:td invoice-number]
|
||||
[:td date]
|
||||
[:td total]])]]]))
|
||||
{:component-did-mount #(re-frame/dispatch [::events/view-unpaid-invoices]) })])
|
||||
(if (:loading @status)
|
||||
[:div {:class "inbox-messages"}
|
||||
[:h1.title
|
||||
[:i.fa.fa-spin.fa-spinner]]]
|
||||
[:table {:class "table", :style {:width "100%"}}
|
||||
[:thead
|
||||
[:tr
|
||||
[:th "Customer"]
|
||||
[:th "Invoice #"]
|
||||
[:th "Date"]
|
||||
[:th "Amount"]]]
|
||||
[:tbody (for [{:keys [customer-identifier invoice-number date total id] :as i} @invoices]
|
||||
^{:key (str customer-identifier "-" invoice-number "-" date "-" total "-" id)}
|
||||
[:tr
|
||||
[:td customer-identifier]
|
||||
[:td invoice-number]
|
||||
[:td date]
|
||||
[:td total]])]])]))
|
||||
{:component-will-mount #(re-frame/dispatch-sync [::events/view-unpaid-invoices]) })])
|
||||
|
||||
(defmethod active-page :paid-invoices []
|
||||
[:div {:class "inbox-messages"}
|
||||
@@ -121,7 +124,7 @@
|
||||
(re-frame/dispatch [::events/reject-invoices]))}
|
||||
"Reject all"]
|
||||
]]]))
|
||||
{:component-did-mount (fn []
|
||||
{:component-will-mount (fn []
|
||||
(go
|
||||
(->> (<! (http/get "/api/invoices/pending"))
|
||||
:body
|
||||
|
||||
Reference in New Issue
Block a user