add default price source selection configuration for the stats page

This commit is contained in:
Gered 2018-06-16 11:34:53 -04:00
parent 503b5f3551
commit f527c1fab0
2 changed files with 8 additions and 2 deletions

View file

@ -234,9 +234,13 @@
[widget-row [big-number-statistic "Complete Sets" @total-sets-owned-all-from]]
[widget-row [big-number-statistic "Owned Foil Cards" @owned-foil-total]]]))
(defn default-price-source
[]
(if (exists? js/__defaultPriceSource)
js/__defaultPriceSource))
(defonce settings (r/atom {:online? false
:pricing-source nil}))
:pricing-source (default-price-source)}))
(defvc stats-page
[list-id]

View file

@ -34,7 +34,9 @@
[:a {:href "https://github.com/gered/mtgcoll"} "GitHub Project"]]]]
(js-env-settings "" (boolean (config/get :dev?)))
(javascript-tag
(string/join "\n" [(str "var __authRequired = " (boolean (seq (config/get :users))))]))
(string/join "\n" [(str "var __authRequired = " (boolean (seq (config/get :users))) ";")]))
(if-let [default-price-source (config/get :default-price-source)]
(javascript-tag (str "var __defaultPriceSource = '" default-price-source "';")))
(include-js "cljs/app.js")]))
(def main-page-routes