more elegant no-anti-forgery-field-rendering

neo4j-4
Josha von Gizycki 5 years ago
parent 39e677c2f9
commit 0cf9596f87

@ -18,7 +18,7 @@
commons-codec]]
[ring/ring-json "0.5.0"]
[hiccup "1.0.5"]
[joshavg/formulare "0.5.0-SNAPSHOT"]
[joshavg/formulare "0.6.0"]
;; compojure uses old transitive dependencies of ring
;; specifiy them here explicitly so newer versions

@ -19,8 +19,8 @@
(defn bulk-link-form [link-forms]
(map (fn [{:keys [schema form]}]
(let [name-field (keyword (str "name-" (:uuid schema)))
instances-field (keyword (str "instances-" (:uuid schema)))]
(let [name-field (keyword (str "name[" (:uuid schema) "]"))
instances-field (keyword (str "instances[" (:uuid schema) "]"))]
{:schema schema
:form (-> form
(assoc-in [:fields name-field]

@ -7,6 +7,7 @@
[ring.util.anti-forgery :refer [anti-forgery-field]]))
(defn bulk-link-selection [instance forms req]
(clojure.pprint/pprint forms)
(view/layout
:request req
:content
@ -20,6 +21,8 @@
(for [{:keys [schema form]} forms]
[:fieldset
[:legend "Schema " [:strong (-> schema :name h)]]
(rest
(form/render-widgets form nil req))])
(form/render-widgets form
nil
req
{:render-anti-forgery-field? false})])
(hform/submit-button "Link!"))]))

Loading…
Cancel
Save