adding more sidebar cleanup.
This commit is contained in:
@@ -143,7 +143,7 @@ nav.navbar .navbar-item.is-active {
|
||||
font-weight: 700;
|
||||
}
|
||||
.aside .main {
|
||||
padding: 40px 40px 40px 30px;
|
||||
padding: 40px 10px 40px 30px;
|
||||
color: #6F7B7E;
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ nav.navbar .navbar-item.is-active {
|
||||
font-weight: 500;
|
||||
}
|
||||
.messages {
|
||||
padding: 40px 20px;
|
||||
padding: 40px 40px 0px 20px;
|
||||
}
|
||||
.message {
|
||||
padding: 40px 20px;
|
||||
|
||||
@@ -28,16 +28,16 @@
|
||||
(s/def ::bank-accounts (s/coll-of ::bank-account))
|
||||
|
||||
(s/def ::location string?)
|
||||
(s/def ::locations (s/coll-of ::location))
|
||||
(s/def ::locations (s/coll-of ::location :min-count 1))
|
||||
|
||||
(s/def ::email (s/nilable (s/and string? (s/or :is-email #(re-matches email-regex %)
|
||||
:is-empty #(= % "")))))
|
||||
|
||||
|
||||
(s/def ::client (s/keys :req-un [::name ::code]
|
||||
(s/def ::client (s/keys :req-un [::name ::code ::locations]
|
||||
:opt-un [::email
|
||||
::address
|
||||
::locations
|
||||
|
||||
::bank-accounts
|
||||
::id]))
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@
|
||||
(fn [{:keys [visible?]} & children]
|
||||
[css-transition-group {:in visible? :class-names {:exitDone "bounce animated" :exit "fadeOutRight animated" :enter "fadeInRight animated"} :timeout 300 :onEnter (fn [] (reset! final-state true )) :onExited (fn [] (reset! final-state false))}
|
||||
(if (or @final-state visible?)
|
||||
[:aside {:class "column is-4 aside menu hero is-fullheight" :style {:height "100vh" :overflow "auto"}}
|
||||
[:aside {:class "column is-3 aside menu hero is-fullheight" :style {:height "100vh" :overflow "auto"}}
|
||||
[:div.sub-main {:style {:padding-bottom "80px"}}children ]]
|
||||
[:div])])))
|
||||
|
||||
|
||||
@@ -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)
|
||||
""
|
||||
|
||||
Reference in New Issue
Block a user