Skip to content

Commit

Permalink
Removed references to hiccup.
Browse files Browse the repository at this point in the history
  • Loading branch information
macourtney committed Oct 24, 2012
1 parent beaee11 commit 8732ea9
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 17 deletions.
2 changes: 1 addition & 1 deletion conjure_view/project.clj
@@ -1,7 +1,7 @@
(defproject org.conjure/conjure-view "0.9.0-SNAPSHOT"
:description "Conjure view is a library to render html for conjure."
:dependencies [[clojure-tools "1.1.2"]
[hiccup "1.0.1"]
;[hiccup "1.0.1"]
[org.conjure/conjure-config "0.9.0-SNAPSHOT"]
[org.conjure/conjure-html "0.9.0"]
[org.conjure/conjure-util "0.9.0-SNAPSHOT"]
Expand Down
18 changes: 8 additions & 10 deletions conjure_view/src/conjure/view/form.clj
Expand Up @@ -8,7 +8,6 @@
(require ['clojure.tools.map-utils :as 'map-utils])
(require ['conjure.util.conjure-utils :as 'conjure-utils])
(require ['conjure.util.request :as 'request])
(require ['hiccup.core :as 'hiccup])

(defn
#^{:doc "Returns the name value for the given record name and key name. Note, both record-name-str and key-name-str must
Expand Down Expand Up @@ -58,7 +57,7 @@ an optional option map for the html options." }
{ :type (conjure-str-utils/str-keyword input-type),
:id (id-value record-name-str key-name-str),
:name (name-value record-name-str key-name-str)
:value (hiccup/h (get record key-name)) }
:value (get record key-name) }
html-options)]))

(defn
Expand Down Expand Up @@ -91,7 +90,7 @@ an optional option map for the html options." }
html-options
{ :id (id-value record-name-str key-name-str),
:name (name-value record-name-str key-name-str) })
(hiccup/h (get record key-name)) ])))
(get record key-name) ])))

(defn
#^{ :doc "Creates an input tag of type \"hidden\" for a field of name key-name in record of the given name. You can pass
Expand Down Expand Up @@ -128,13 +127,12 @@ nothing if a check box is not checked, therefore this function also creates a hi
radio-button
([record record-name key-name value] (radio-button record record-name key-name value {}))
([record record-name key-name value html-options]
(let [str-value (if value (hiccup/h value))]
(input :radio record record-name key-name
(merge
(map-utils/drop-nils
{ :value (if value (hiccup/h value)),
:checked (if (= (get record key-name) value) "checked") })
html-options)))))
(input :radio record record-name key-name
(merge
(map-utils/drop-nils
{ :value value,
:checked (if (= (get record key-name) value) "checked") })
html-options))))

(defn
#^{ :doc "Creates a form with a single input of type button for use when you only need a button somewhere.
Expand Down
9 changes: 3 additions & 6 deletions conjure_view/src/conjure/view/select.clj
Expand Up @@ -2,8 +2,6 @@

(in-ns 'conjure.view.base)

(require ['hiccup.core :as 'hiccup])

(defn
#^{ :doc "Returns the name of the given option. Option can be a keyword, string
or map. If option is a map, then the value of :name is returned." }
Expand Down Expand Up @@ -59,9 +57,8 @@ option names to option-tag option maps."}

(defn
option-from-record [record name-key value-key]
(let [value (hiccup/h (get record value-key))
name (get record name-key)]
{ :name (if name (hiccup/h name) value)
(let [value (get record value-key)]
{ :name (or (get record name-key) value)
:value value }))

(defn
Expand Down Expand Up @@ -128,4 +125,4 @@ to the given value." }
([record record-name key-name select-options]
(select-tag
{ :html-options (record-html-options (:html-options select-options) record-name key-name)
:options (options-select-value (:options select-options) (hiccup/h (get record key-name))) })))
:options (options-select-value (:options select-options) (get record key-name)) })))

0 comments on commit 8732ea9

Please sign in to comment.