             (dom/h3 #js {:className "center about_strip"} "You are now officially a Dave Conservatoire subscriber. ")
             (dom/h3 #js {:className "center about_strip"} "You are playing a role in making a world class music education available to everyone everywhere!")
             (dom/h3 #js {:className "center about_strip"} " Ready to get back to learning? ")
-            (dom/div #js {:className "pad45"})(dom/a #js {:href "/", :className "big_button"} "Let's go!")
+            (dom/div #js {:className "pad45"}) (dom/a #js {:href "/", :className "big_button"} "Let's go!")
             (dom/div #js {:className "pad25"})))))))
 
 (defmethod r/route->component ::r/thanks [_] ThanksPage)
 
+
+(defn paypal-donate-url [donation-value]
+  (str "https://www.paypal.com/cgi-bin/webscr?business=dave@daveconservatoire.org&cmd=_xclick-subscriptions&currency_code=USD&p3=1&t3=M&no_shipping=1&src=1&sra=1&a3=" donation-value "&item_name=Dave%20Conservatoire%20Subscription%20&return_url=http://www.daveconservatoire.org/thanks&cancel_return=http://www.daveconservatoire.org/subscribe"))
 
 (om/defui ^:once SubscriptionPage
   static uc/InitialAppState
-  (initial-state [_ _] {:ui/donation-value 9})
-
-  static om/IQuery
-  (query [_] [:ui/donation-value ])
+  (initial-state [_ _] {:ui/donation-value 9 :ui/show-modal? false})
+
+  static om/IQuery
+  (query [_] [:ui/donation-value :ui/show-modal?])
 
   static om/Ident
   (ident [_ props] [:page/by-id "subscribe-page"])
 
   Object
   (render [this]
-    (let [{:keys [ui/donation-value]} (om/props this)]
+    (let [{:keys [ui/donation-value ui/show-modal?]} (om/props this)]
       (dom/div #js {}
         (course-banner {:title "Voluntary Subscription" :intro "Dave Conservatoire will always be free. But please consider subscribing!"})
         (dom/div #js {:className "container wrapper"}

            [clojure.string :as str])
  (:import goog.i18n.DateTimeFormat
           goog.async.Debouncer))

(defn debounce [f interval]
  (let [dbnc (Debouncer. f interval)]

                  (dom/div #js {:className "alert alert-success subchange"}
                    (dom/p #js {:id "subamount"}
                      "I would like to subscribe to Dave Conservatoire for $" (or donation-value "9") " per month.")
                    (dom/a #js {:className "btn btn-block btn-primary dc-orange subbutton" :target "_blank" :href (paypal-donate-url (or donation-value 9))}
                      "\n\t\t         Submit\n\t\t     "))
                  (dom/div #js {:className "alert alert-danger subchange"}
                    (dom/p #js {:id "subamount"}
                      "I am unable to support Dave Conservatoire at this time. \uD83D\uDE22")
                    (dom/a #js {:className "btn btn-block btn-primary dc-orange subbutton"
                                :onClick #(um/set-value! this :ui/show-modal? true)}
                      "\n\t\t         Submit\n\t\t     ")))))))
        (if show-modal?
          (modal #:ui.modal{:title   "Sure you can't just nudge us in the right direction?"
                            :footer  (fn [{:ui.modal/keys [title footer onClose onConfirm]}]
                                       (dom/div #js {:className "modal-footer"}
                                         (dom/a #js {:className "btn btn-success"
                                                     :href      (paypal-donate-url 1)
                                                     :target    "_blank"}
                                           "Okay!  Let's do this! ($1/month subscription)")
                                         (link {:className  "btn btn-danger"
                                                ::r/handler ::r/socialmedia}
                                           "Still a no, sorry")))
                            :onClose #(um/set-value! this :ui/show-modal? false)}
            (dom/p #js {} "Could you spare just $1 each month for a worthy cause?  Music students around the world will thank you for it!")
            (dom/p #js {} "A hard-up student?  No worries, we're still cool.")))))))

(defmethod r/route->component ::r/subscribe [_] SubscriptionPage)

