From 20e9310e18417dbd3af427abec8316daff336a6b Mon Sep 17 00:00:00 2001 From: Bryce Covert Date: Mon, 18 Feb 2019 07:14:52 -0800 Subject: [PATCH] working on new panel. --- .../auto_ap/views/pages/admin/clients.cljs | 52 +++++++++++-------- 1 file changed, 31 insertions(+), 21 deletions(-) diff --git a/src/cljs/auto_ap/views/pages/admin/clients.cljs b/src/cljs/auto_ap/views/pages/admin/clients.cljs index 323d200a..187dccd2 100644 --- a/src/cljs/auto_ap/views/pages/admin/clients.cljs +++ b/src/cljs/auto_ap/views/pages/admin/clients.cljs @@ -204,7 +204,7 @@ [:form [:h1.title.is-2 "Add client"] [:div.field - [:label.label "Name"] + [:p.help "Name"] [:div.control [bind-field [:input.input {:type "text" @@ -214,7 +214,7 @@ :subscription new-client}]]]] [:div.field - [:label.label "Client code"] + [:p.help "Client code"] [:div.control [bind-field [:input.input {:type "code" @@ -224,7 +224,7 @@ :subscription new-client}]]]] [:div.field - [:label.label "Email"] + [:p.help "Email"] [:div.control [bind-field [:input.input {:type "email" @@ -234,7 +234,7 @@ :subscription new-client}]]]] [:div.field - [:label.label "Locations"] + [:p.help "Locations"] [:div.control [:div.field.has-addons [:p.control @@ -253,9 +253,33 @@ [address-field {:field [:address] :event ::change-new :subscription new-client}]] + [:nav.panel + [:p.panel-heading "Bank accounts"] + (for [{:keys [type code name number check-number id]} (:bank-accounts new-client)] + (if id + ^{:key code} + + [:a.panel-block {:style {:position "relative"}} + [:span.panel-icon + (if (= type :check) + [:span.icon-check-payment-sign] + [:span.icon-accounting-bill])] + code ": " name] + + ^{:key code} + [:li [:strong "* " code ": " name] [:button.button {:on-click (dispatch-event [::remove-new-bank-account code])} [:span.icon [:i.fa.fa-times]]]])) + [:div.panel-block + [:nav.level + [:div.level-item.has-text-centered + [:button.button.is-outlined.is-primary.is-fullwidth "Add Checking Account"]] + [:div.level-item.has-text-centered + + [:button.button.is-outlined.is-primary.is-fullwidth "Add Cash Account"]]]] + #_(for [[index {:keys [name code number check-number]}] (map vector (range) (:new-bank-accounts new-client))] + ^{:key index} [:li [:strong "* " code ": " name] [:button.button {:on-click (dispatch-event [::remove-new-bank-account index])} [:span.icon [:i.fa.fa-times]]]])] - [:h2.subtitle "Add bank account"] - [:div {:style {:padding-bottom "0.75em" :padding-top "0.75em" :background "hsl(0, 0%, 96%)"}} + #_[:h2.subtitle "Add bank account"] + #_[:div {:style {:padding-bottom "0.75em" :padding-top "0.75em" :background "hsl(0, 0%, 96%)"}} [:label.label "General"] [horizontal-field nil @@ -348,21 +372,7 @@ "disabled") :on-click (dispatch-event [::add-new-bank-account])} "Add"]]]] - [:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em"}} - [:h2.subtitle "Bank Accounts"] - [:div.field - nil - [:div.control - [:ul - - (for [{:keys [code name number check-number id]} (:bank-accounts new-client)] - (if id - ^{:key code} - [:li code ": " name] - ^{:key code} - [:li [:strong "* " code ": " name] [:button.button {:on-click (dispatch-event [::remove-new-bank-account code])} [:span.icon [:i.fa.fa-times]]]])) - (for [[index {:keys [name code number check-number]}] (map vector (range) (:new-bank-accounts new-client))] - ^{:key index} [:li [:strong "* " code ": " name] [:button.button {:on-click (dispatch-event [::remove-new-bank-account index])} [:span.icon [:i.fa.fa-times]]]])]]]] + #_(when (:saving? new-client) [:div.is-overlay {:style {"backgroundColor" "rgba(150,150,150, 0.5)"}}]) #_(println (s/explain-data ::entity/client new-client))