                (swap! voter-ips conj (:remote-addr req))
                {:session {:voted? true},
                 :status 201
-                :body (str "Thank you for voting for team " teamid "!")})))
+                :body (page "Voted" [:p "Thank you for voting for team " teamid "!"])})))
+     (GET "/await-vote" [:as req]
+          (if (= :voting state)
+            (redirect "/vote")
+            (page-await-vote (get-in req [:headers "referer"]))))
      (GET "/vote" [] "Sorry, you can only POST to this page")
      (GET "/vote-results" [] (page-vote-results @teams @votes))
      (GET "/projector" []

      xhr.send();
"))

(defn page-gamemaster []
  "Control page for the GameMaster: 1. task info, 2. show task to others, 3. start brainstorming?, 4. start voting, 5. show number voted, 6. show voting results"
  (page
   "GameMaster Control"
   [:h1 "You control the game!"]

   [:form#newGroupForm {:action "/team"}
    [:button.btn {:type "sumbit"} "Start a new team!"]]))

(defn page-team-idea [team-id idea published]
  "Form to submit name of team's gamification idea"
  (page
   "Idea"                               ; TODO better title
   (when published
     [:p.text-success "Your idea has been published"])
   [:form {:action (str "/team/" team-id "/idea"), :method "post"}
    [:label (str "Publish team " team-id "'s gamification idea:")
     [:br]
     [:input {:type "text", :name "idea", :value idea,
              :autofocus "true",
              :title "Describe your idea"}]]
    [:button.btn {:type "submit"} "Publish"]]
   [:p "Or "
    [:a {:href "/await-vote"} "await voting for the best idea"]
    " to be started"]))

(defn page-teams [teams]
  "Overveiw of all teams and their ideas"
