 (ns clojento.views.admin
   (:require [clojento.models.admin :as admin] [clojento.views.common :as common])
-  (:use [noir.core :only [defpage url-for]]
+  (:use [noir.core :only [defpage defpartial url-for]]
         [noir.response :only [redirect]]
         [korma.core :only [select fields]]
         [hiccup.core :only [html]]))

	[:h1 (str "User " id " Detail Page")]
	[:hr]))

(defpage users_index "/admin/users" {} (common/layout
	[:h1 "Users"]
	[:hr]
	(let [users (select admin/user) user (first users)]
		[:table
			[:thead [:tr
				[:th "id"]

				[:th "firstname"]
				[:th "lastname"]
			]]
			[:tbody (map user-line users) ]
		])))

(defpage role_show "/admin/role/:id" {id :id}
