You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
wanijo/src/wanijo/user/view.clj

22 lines
702 B

(ns wanijo.user.view
(:require [hiccup.form :as hform]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[formulare.core :as form]
[wanijo.infra.view :as view]
[wanijo.infra.routing :refer [path]]
[wanijo.user.db :as domain]))
(def edit-form
{:fields {:ident {:label "Ident"
:required false
:spec ::domain/ident}}})
(defn profile! [req user]
(view/layout
:session (:session req)
:content
[[:h1 "Hi, " (get-in req [:session :ident])]
(hform/form-to [:post (path :user-edit)]
(anti-forgery-field)
(form/render-widgets edit-form user req))]))