adding new clients improvement more.

This commit is contained in:
Bryce Covert
2019-02-16 18:35:44 -08:00
parent 193a46e12c
commit b697107a7f
7 changed files with 10700 additions and 176 deletions

10525
resources/public/css/bulma.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@@ -146,7 +146,7 @@ nav.navbar .navbar-item.is-active {
font-weight: 700;
}
.aside .main {
padding: 40px;
padding: 40px 40px 40px 30px;
color: #6F7B7E;
}

View File

@@ -7,7 +7,7 @@
<title>Integreat</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" integrity="sha256-eZrrJcwDc/3uDhsdt61sL2oOBY362qM3lon1gyExkL0=" crossorigin="anonymous" />
<link href="/css/font.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/bulma.min.css" integrity="sha256-HEtF7HLJZSC3Le1HcsWbz1hDYFPZCqDhZa9QsCgVUdw=" crossorigin="anonymous" />
<link rel="stylesheet" href="/css/bulma.min.css" />
<link rel="stylesheet" href="/css/bulma-calendar.min.css" />
<link rel="stylesheet" href="/css/bulma-badge.min.css" />
<link rel="stylesheet" href="/css/animate.css" />

View File

@@ -90,7 +90,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?)
[:div.aside
[:aside {:class "column is-4 aside menu hero is-fullheight"}
[:div.sub-main children]]
[:div])])))
@@ -100,10 +100,10 @@
[:div
[navbar ap]
[:div {:class "columns ", :id "mail-app"}
[:aside {:class "column is-narrow aside menu hero is-fullheight"}
[:aside {:class "column aside menu hero is-2"}
[:div.main.left-nav
side-bar]]
[:div {:class "column messages hero is-fullheight", :id "message-feed"}
[:div {:class "column messages hero is-fullheight ", :id "message-feed"}
^{:key (str "active-page-" (:name client))}
[:div.inbox-messages main]]
[appearing-side-bar {:visible? right-side-bar-visible?} right-side-bar]]

View File

@@ -372,181 +372,180 @@
(defn new-client-form []
(let [new-client (:new-client @(re-frame/subscribe [::subs/admin]))
error (:error (:client @(re-frame/subscribe [::subs/admin])))]
[:div
[:form
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em"}}
[:h1.title "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}]]]]
[: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}]]]]
[: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"]
[address-field {:field [:address]
:event ::change-new
:subscription new-client}]]
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em" :background "hsl(0, 0%, 96%)"}}
[:h2.subtitle "Add bank account"]
[:label.label "General"]
[horizontal-field
nil
[:div.control
[:p.help "Account Code"]
[:div.field.has-addons.is-extended
[:p.control [:a.button.is-static (:code new-client) "-" ]]
[:p.control
[bind-field
[:input.input {:type "code"
:field [:new-account :code]
:spec ::entity/code
:event ::change-new
:subscription new-client}]]]]]
[:div.control
[:p.help "Nickname"]
[bind-field
[:input.input {:placeholder "BOA Checking #1"
:type "text"
:field [:new-account :name]
:event ::change-new
:subscription new-client}]]]]
[:label.label "Bank"]
[horizontal-field
nil
[:div.control
[:p.help "Bank Name"]
[bind-field
[:input.input {:placeholder "Bank of America"
:type "text"
:field [:new-account :bank-name]
:event ::change-new
:subscription new-client}]]]
[:div.control
[:p.help "Routing #"]
[bind-field
[:input.input {:placeholder "104819123"
:type "text"
:field [:new-account :routing]
:event ::change-new
:subscription new-client}]]]
[:div.control
[:p.help "Bank code"]
[bind-field
[:input.input {:placeholder "12/10123"
:type "text"
:field [:new-account :bank-code]
:event ::change-new
:subscription new-client}]]]]
[:label.label "Checking account"]
[horizontal-field
nil
[:div.control
[:p.help "Account #"]
[bind-field
[:input.input {:placeholder "123456789"
:type "text"
:field [:new-account :number]
:event ::change-new
:subscription new-client}]]]
[:div.control
[:p.help "Check Number"]
[bind-field
[:input.input {:placeholder "10000"
:type "text"
:field [:new-account :check-number]
:event ::change-new
:subscription new-client}]]]]
[:div.field
[:label.label "Yodlee Account"]
[:div.control
[bind-field
[:input.input {:placeholder "Yodlee Account #"
:type "text"
:field [:new-account :yodlee-account-id]
:event ::change-new
:subscription new-client}]]]
]
[:div.field
[:div.control
#_(println (s/explain-data ::entity/bank-account (:new-account new-client)))
[:button.button.is-primary {:disabled (if (and (doto (s/valid? ::entity/bank-account (:new-account new-client)) println)
(not ((set (map :code (:new-bank-accounts new-client)))
(str (:code new-client) "-" (-> new-client :new-account :code)))))
""
"disabled")
:on-click (dispatch-event [::add-new-new-bank-account])} "Add"]]]]
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em"}}
[:h2.subtitle "Address"]
[address-field {:field [:address]
:event ::change-new
:subscription new-client}]]
[: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)]
^{:key id} [:li code ": " name])
(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))
[:section.section {:style {:padding-bottom "0.75em" :padding-top "0.75em" :background "hsl(0, 0%, 96%)"}}
[:h2.subtitle "Add bank account"]
[:label.label "General"]
[horizontal-field
nil
[:div.control
[:p.help "Account Code"]
[:div.field.has-addons.is-extended
[:p.control [:a.button.is-static (:code new-client) "-" ]]
[:p.control
[bind-field
[:input.input {:type "code"
:field [:new-account :code]
:spec ::entity/code
:event ::change-new
:subscription new-client}]]]]]
[:div.control
[:p.help "Nickname"]
[bind-field
[:input.input {:placeholder "BOA Checking #1"
:type "text"
:field [:new-account :name]
:event ::change-new
:subscription new-client}]]]]
[:label.label "Bank"]
[horizontal-field
nil
[:div.control
[:p.help "Bank Name"]
[bind-field
[:input.input {:placeholder "Bank of America"
:type "text"
:field [:new-account :bank-name]
:event ::change-new
:subscription new-client}]]]
[:div.control
[:p.help "Routing #"]
[bind-field
[:input.input {:placeholder "104819123"
:type "text"
:field [:new-account :routing]
:event ::change-new
:subscription new-client}]]]
[:div.control
[:p.help "Bank code"]
[bind-field
[:input.input {:placeholder "12/10123"
:type "text"
:field [:new-account :bank-code]
:event ::change-new
:subscription new-client}]]]]
[:label.label "Checking account"]
[horizontal-field
nil
[:div.control
[:p.help "Account #"]
[bind-field
[:input.input {:placeholder "123456789"
:type "text"
:field [:new-account :number]
:event ::change-new
:subscription new-client}]]]
[:div.control
[:p.help "Check Number"]
[bind-field
[:input.input {:placeholder "10000"
:type "text"
:field [:new-account :check-number]
:event ::change-new
:subscription new-client}]]]]
[:div.field
[:label.label "Yodlee Account"]
[:div.control
[bind-field
[:input.input {:placeholder "Yodlee Account #"
:type "text"
:field [:new-account :yodlee-account-id]
:event ::change-new
:subscription new-client}]]]
]
[:div.field
[:div.control
#_(println (s/explain-data ::entity/bank-account (:new-account new-client)))
[:button.button.is-primary {:disabled (if (and (doto (s/valid? ::entity/bank-account (:new-account new-client)) println)
(not ((set (map :code (:new-bank-accounts new-client)))
(str (:code new-client) "-" (-> new-client :new-account :code)))))
""
"disabled")
:on-click (dispatch-event [::add-new-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)]
^{:key id} [:li code ": " name])
(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))
(when error
[:div.notification.is-warning.animated.fadeInUp
error]
)
[:submit.button.is-large.is-primary {:disabled (if (s/valid? ::entity/client new-client)
""
"disabled")
:on-click (dispatch-event [::save-new-client])
:class (str @(re-frame/subscribe [::loading-class ::save-client]) (when error " animated shake"))} "Save"]]]))
(when error
[:div.notification.is-warning.animated.fadeInUp
error]
)
[:submit.button.is-large.is-primary {:disabled (if (s/valid? ::entity/client new-client)
""
"disabled")
:on-click (dispatch-event [::save-new-client])
:class (str @(re-frame/subscribe [::loading-class ::save-client]) (when error " animated shake"))} "Save"]]))
(defn admin-clients-page []
(let [{:keys [adding-client?]} @(re-frame/subscribe [::subs/admin])]