inventory display text changes depending on what list is being used

This commit is contained in:
Gered 2016-08-01 13:49:31 -04:00
parent 3dbc417885
commit 1abbcf1302

View file

@ -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,8 +101,9 @@
: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]])}
(let [owned-list? (= c/owned-list-id list-id)]
[bs/Button [bs/Button
(merge (merge
{:block true} {:block true}
@ -109,7 +111,11 @@
(if button-style {:bsStyle button-style})) (if button-style {:bsStyle button-style}))
(if (and num-owned (if (and num-owned
(> (or num-owned 0) 0)) (> (or num-owned 0) 0))
(if owned-list?
[:span "Owned: " [:strong (or num-owned 0)]] [:span "Owned: " [:strong (or num-owned 0)]]
(if owned? "Owned" "Not Owned")) [:span [:strong (or num-owned 0)]])
(if owned-list?
(if owned? "Owned" "Not Owned")
(if owned? "Yes" "None")))
" " " "
[:span.caret]]]) [:span.caret]])])