improved table.

This commit is contained in:
BC
2019-02-19 09:30:26 -08:00
parent 5435b6a317
commit 76f460c52c
2 changed files with 60 additions and 56 deletions

View File

@@ -319,8 +319,8 @@ nav.navbar .navbar-item.is-active {
background-color:#F5F5F5; background-color:#F5F5F5;
} }
.table { table-layout: fixed } .table { table-layout: fixed }
.table td {text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding: 9px; } .table td {text-overflow: ellipsis; overflow: hidden; white-space: nowrap; padding: 9px; height: 60px; vertical-align: middle; }
.table td.expandable {text-overflow: ellipsis; overflow: visible; white-space: nowrap; padding: 9px; } .table td.expandable {text-overflow: ellipsis; overflow: visible; white-space: nowrap; padding: 9px; height: 60px; vertical-align: middle; }
.table td.no-border { border: none; } .table td.no-border { border: none; }
.typeahead { .typeahead {

View File

@@ -70,6 +70,8 @@
percentage-size (if selected-client "%50%" "33%") percentage-size (if selected-client "%50%" "33%")
] ]
[:div [:div
[paginator {:start start :end end :count count :total total [paginator {:start start :end end :count count :total total
:on-change (fn [p ] :on-change (fn [p ]
(on-params-change (merge @params p) ))}] (on-params-change (merge @params p) ))}]
@@ -127,7 +129,7 @@
"Outstanding"] "Outstanding"]
[:th { [:th {
:style {:width "15em" :cursor "pointer"} :style {:width "20rem" :cursor "pointer"}
} }
@@ -160,6 +162,9 @@
[:td (gstring/format "$%.2f" total )] [:td (gstring/format "$%.2f" total )]
[:td (gstring/format "$%.2f" outstanding-balance )] [:td (gstring/format "$%.2f" outstanding-balance )]
[:td.expandable [:td.expandable
[:div.buttons
(when (seq expense-accounts) (when (seq expense-accounts)
[:div.dropdown.is-right {:class (if (= id visible-expense-accounts) [:div.dropdown.is-right {:class (if (= id visible-expense-accounts)
@@ -184,13 +189,12 @@
(when expense-event (when expense-event
[:a.dropdown-item.is-primary {:on-click (dispatch-event (conj expense-event i))} "Change"])]]]) [:a.dropdown-item.is-primary {:on-click (dispatch-event (conj expense-event i))} "Change"])]]])
[:span {:style {:margin-left "1em"}}] [:span {:style {:margin-left "1em"}}]
(when (and on-edit-invoice (not= ":voided" (:status i))) (when (and on-edit-invoice (not= ":voided" (:status i)))
[:button.button {:on-click (fn [] (on-edit-invoice i))} [:span.icon [:i.fa.fa-pencil]]]) [:a.button {:on-click (fn [] (on-edit-invoice i))} [:span.icon [:i.fa.fa-pencil]]])
(when (and on-void-invoice (= (:outstanding-balance i) (:total i)) (not= ":voided" (:status i))) (when (and on-void-invoice (= (:outstanding-balance i) (:total i)) (not= ":voided" (:status i)))
[:button.button.is-outlined {:on-click (fn [] (on-void-invoice i))} [:span.icon [:span.icon-bin-2 {:style {:font-weight "400"}}]]]) [:a.button {:on-click (fn [] (on-void-invoice i))} [:span.icon [:span.icon-bin-2 {:style {:font-weight "400"}}]]])
(when (and on-unvoid-invoice (= ":voided" (:status i))) (when (and on-unvoid-invoice (= ":voided" (:status i)))
[:button.button.is-outlined {:on-click (fn [] (on-unvoid-invoice i))} [:span [:span.icon [:i.fa.fa-undo]]]]) [:a {:on-click (fn [] (on-unvoid-invoice i))} [:span [:span.icon [:i.fa.fa-undo]]]])
(when (seq payments) (when (seq payments)
[:div.dropdown.is-right {:class (if (= id visible-checks) [:div.dropdown.is-right {:class (if (= id visible-checks)
@@ -216,6 +220,6 @@
"has-text-success")]} "has-text-success")]}
[:i.fa.fa-money]] (str " " (:check-number (:payment payment)) " (" (gstring/format "$%.2f" (:amount payment) ) ") " [:i.fa.fa-money]] (str " " (:check-number (:payment payment)) " (" (gstring/format "$%.2f" (:amount payment) ) ") "
(when (= :cleared (:status (:payment payment))) (when (= :cleared (:status (:payment payment)))
(str " - " (:post-date (:transaction (:payment payment))))))]))]]]) (str " - " (:post-date (:transaction (:payment payment))))))]))]]])]
]]))]]])))) ]]))]]]))))