added support

This commit is contained in:
Bryce Covert
2018-04-30 21:20:29 -07:00
parent 5ab67c5887
commit 9b95b5b5f2
5 changed files with 74 additions and 0 deletions

View File

@@ -230,6 +230,46 @@
:subscription editing-vendor}]]
" Never"]]]
[:h2.subtitle "Clients"]
[horizontal-field
nil
[:div.control
[:div.select.is-expanded
[bind-field
[:select {:type "select"
:field :new-relationship-company
:event ::events/change
:subscription editing-vendor
}
(for [company @(re-frame/subscribe [::subs/companies])]
[:option {:value (:id company)} (:name company)])]]]]
[:div.control
[bind-field
[:input.input {:type "text"
:field :new-relationship-account-number
:subscription editing-vendor
:event ::events/change
:placeholder "Account number"}]]]
[:div.control
[:button.button.is-primary
{:on-click (dispatch-event [::events/add-relationship])}
[:span.icon
[:i.fa.fa-plus]]]]]
[horizontal-field
nil
[:ul
(for [[i r] (map vector (range) (:relationships editing-vendor))]
^{:key i}
[:li (:account-number r)
(:company-id r)
[:a
{:on-click (dispatch-event [::events/remove-relationship i])}
[:span.icon
[:i.fa.fa-times]]]]
)]]
(when (:saving? editing-vendor) [:div.is-overlay {:style {"backgroundColor" "rgba(150,150,150, 0.5)"}}])]