Hi,
The problem is that when failure is true (if (not failure) (substitute
nil))) evaluates to nil and when failure is false it evaluates to
(substitute nil).
Both nil and (substitute nil) have the same consequences: they prune
the current node.
The correct right-hand value for this rule is #(when failure %). When
failure return the current node else remove it (return nil).
(deftemplate login-page "login.html" [title failure]
[:title] (prepend title)
[:form] (set-attr :action "/login" :method "post")
[:#login_wrapper :> :div] #(when failure %))
hth,
Christophe
--
Professional:
http://cgrand.net/ (fr)
On Clojure:
http://clj-me.cgrand.net/ (en)