Sort of semi-working UI.

This commit is contained in:
simon 2014-07-02 21:54:35 +01:00
parent 8a9aae56e0
commit ce2a04477a
12 changed files with 407 additions and 86 deletions

View file

@ -1,17 +1,22 @@
(ns mw-ui.routes.home
(:use compojure.core)
(:require [mw-ui.layout :as layout]
(:require [hiccup.core :refer [html]]
[mw-ui.layout :as layout]
[mw-ui.util :as util]
[mw-ui.render-world :as world]))
[mw-ui.render-world :as world]
[noir.session :as session]))
(defn home-page []
(layout/render
"home.html" {:content (util/md->html "/md/docs.md")}))
"home.html" {:title "Welcome to MicroWorld" :content (util/md->html "/md/docs.md")}))
(defn about-page []
(layout/render "about.html"))
(layout/render "about.html" {:title "About MicroWorld" :content (util/md->html "/md/about.md")}))
(defn world-page []
(layout/render "world.html" {:title "Watch your world grow" :content (html (world/render-world-table)) :seconds (or (session/get :seconds) 5) :maybe-refresh "refresh"}))
(defroutes home-routes
(GET "/" [] (home-page))
(GET "/about" [] (about-page))
(GET "/world" [] (world/render-world)))
(GET "/world" [] (world-page)))