adding more sidebar cleanup.

This commit is contained in:
Bryce Covert
2019-02-17 08:46:43 -08:00
parent fdcc3192a1
commit 23d1fb9369
4 changed files with 50 additions and 52 deletions

View File

@@ -82,6 +82,7 @@
:bank-code bank-code})
(:bank-accounts new-client-data))}
user @(re-frame/subscribe [::subs/token])]
(if (s/valid? ::entity/client new-client-req)
{:db (-> new-client-form
@@ -187,53 +188,51 @@
(defn new-client-form []
(let [{error :error new-client :data } @(re-frame/subscribe [::form ::new-client])]
[:form
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em"}}
[:h1.title.is-2 "Add client"]
[:div.field
[:label.label "Name"]
[:div.control
[bind-field
[:input.input {:type "text"
:field :name
:spec ::entity/name
:event ::change-new
:subscription new-client}]]]]
[:h1.title.is-2 "Add client"]
[:div.field
[:label.label "Name"]
[:div.control
[bind-field
[:input.input {:type "text"
:field :name
:spec ::entity/name
:event ::change-new
:subscription new-client}]]]]
[:div.field
[:label.label "Client code"]
[:div.control
[bind-field
[:input.input {:type "code"
:field :code
:spec ::entity/code
:event ::change-new
:subscription new-client}]]]]
[:div.field
[:label.label "Client code"]
[:div.control
[bind-field
[:input.input {:type "code"
:field :code
:spec ::entity/code
:event ::change-new
:subscription new-client}]]]]
[:div.field
[:label.label "Email"]
[:div.control
[bind-field
[:input.input {:type "email"
:field :email
:spec ::entity/email
:event ::change-new
:subscription new-client}]]]]
[:div.field
[:label.label "Email"]
[:div.control
[bind-field
[:input.input {:type "email"
:field :email
:spec ::entity/email
:event ::change-new
:subscription new-client}]]]]
[:div.field
[:label.label "Locations"]
[:div.control
[:div.field.has-addons
[:p.control
[bind-field
[:input.input {:type "text"
:field :location
:event ::change-new
:subscription new-client}]]]
[:p.control [:button.button.is-primary {:on-click (dispatch-event [::add-new-location])} "Add"]]]
[:ul
(for [location (:locations new-client)]
^{:key location} [:li location ])]]]
]
[:div.field
[:label.label "Locations"]
[:div.control
[:div.field.has-addons
[:p.control
[bind-field
[:input.input {:type "text"
:field :location
:event ::change-new
:subscription new-client}]]]
[:p.control [:button.button.is-primary {:on-click (dispatch-event [::add-new-location])} "Add"]]]
[:ul
(for [location (:locations new-client)]
^{:key location} [:li location ])]]]
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em"}}
[:h2.subtitle "Address"]
@@ -356,8 +355,7 @@
(when error
[:div.notification.is-warning.animated.fadeInUp
error]
)
error])
[:submit.button.is-large.is-primary {:disabled (if (s/valid? ::entity/client new-client)
""