inventory display text changes depending on what list is being used
This commit is contained in:
parent
3dbc417885
commit
1abbcf1302
|
@ -6,6 +6,7 @@
|
||||||
[webtools.reagent.bootstrap :as bs]
|
[webtools.reagent.bootstrap :as bs]
|
||||||
[webtools.cljs.ajax :as ajax]
|
[webtools.cljs.ajax :as ajax]
|
||||||
[webtools.cljs.utils :refer [->url]]
|
[webtools.cljs.utils :refer [->url]]
|
||||||
|
[mtgcoll.common :as c]
|
||||||
[mtgcoll.client.auth :as auth]
|
[mtgcoll.client.auth :as auth]
|
||||||
[mtgcoll.client.page :refer [set-error!]]))
|
[mtgcoll.client.page :refer [set-error!]]))
|
||||||
|
|
||||||
|
@ -100,16 +101,21 @@
|
||||||
:trigger "click"
|
:trigger "click"
|
||||||
:root-close true
|
:root-close true
|
||||||
:overlay (r/as-component
|
:overlay (r/as-component
|
||||||
[bs/Popover {:class "inventory" :title "Card Inventory"}
|
[bs/Popover {:class "inventory" :title "Inventory"}
|
||||||
[inventory-management card-id list-id]])}
|
[inventory-management card-id list-id]])}
|
||||||
[bs/Button
|
(let [owned-list? (= c/owned-list-id list-id)]
|
||||||
(merge
|
[bs/Button
|
||||||
{:block true}
|
(merge
|
||||||
(if button-size {:bsSize button-size})
|
{:block true}
|
||||||
(if button-style {:bsStyle button-style}))
|
(if button-size {:bsSize button-size})
|
||||||
(if (and num-owned
|
(if button-style {:bsStyle button-style}))
|
||||||
(> (or num-owned 0) 0))
|
(if (and num-owned
|
||||||
[:span "Owned: " [:strong (or num-owned 0)]]
|
(> (or num-owned 0) 0))
|
||||||
(if owned? "Owned" "Not Owned"))
|
(if owned-list?
|
||||||
" "
|
[:span "Owned: " [:strong (or num-owned 0)]]
|
||||||
[:span.caret]]])
|
[:span [:strong (or num-owned 0)]])
|
||||||
|
(if owned-list?
|
||||||
|
(if owned? "Owned" "Not Owned")
|
||||||
|
(if owned? "Yes" "None")))
|
||||||
|
" "
|
||||||
|
[:span.caret]])])
|
Loading…
Reference in a new issue