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

@@ -143,7 +143,7 @@ nav.navbar .navbar-item.is-active {
font-weight: 700; font-weight: 700;
} }
.aside .main { .aside .main {
padding: 40px 40px 40px 30px; padding: 40px 10px 40px 30px;
color: #6F7B7E; color: #6F7B7E;
} }
@@ -183,7 +183,7 @@ nav.navbar .navbar-item.is-active {
font-weight: 500; font-weight: 500;
} }
.messages { .messages {
padding: 40px 20px; padding: 40px 40px 0px 20px;
} }
.message { .message {
padding: 40px 20px; padding: 40px 20px;

View File

@@ -28,16 +28,16 @@
(s/def ::bank-accounts (s/coll-of ::bank-account)) (s/def ::bank-accounts (s/coll-of ::bank-account))
(s/def ::location string?) (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 %) (s/def ::email (s/nilable (s/and string? (s/or :is-email #(re-matches email-regex %)
:is-empty #(= % ""))))) :is-empty #(= % "")))))
(s/def ::client (s/keys :req-un [::name ::code] (s/def ::client (s/keys :req-un [::name ::code ::locations]
:opt-un [::email :opt-un [::email
::address ::address
::locations
::bank-accounts ::bank-accounts
::id])) ::id]))

View File

@@ -86,7 +86,7 @@
(fn [{:keys [visible?]} & children] (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))} [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?) (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.sub-main {:style {:padding-bottom "80px"}}children ]]
[:div])]))) [:div])])))

View File

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