From f527c1fab03b5d2be7c228de4203281ecfe3b800 Mon Sep 17 00:00:00 2001 From: gered Date: Sat, 16 Jun 2018 11:34:53 -0400 Subject: [PATCH] add default price source selection configuration for the stats page --- src/mtgcoll/client/routes/stats.cljs | 6 +++++- src/mtgcoll/routes/main_page.clj | 4 +++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/mtgcoll/client/routes/stats.cljs b/src/mtgcoll/client/routes/stats.cljs index 9b12e9e..1940e57 100644 --- a/src/mtgcoll/client/routes/stats.cljs +++ b/src/mtgcoll/client/routes/stats.cljs @@ -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] diff --git a/src/mtgcoll/routes/main_page.clj b/src/mtgcoll/routes/main_page.clj index e6a96c2..d8c25b3 100644 --- a/src/mtgcoll/routes/main_page.clj +++ b/src/mtgcoll/routes/main_page.clj @@ -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