some tinkering on bulk link creation

neo4j-4
Josha von Gizycki 4 years ago
parent 56fc3dfe01
commit 3f2623d8b6

@ -283,6 +283,10 @@ form.inline {
}
}
form.no-grid {
display: block;
}
table {
width: 100%;
border-collapse: collapse;
@ -357,6 +361,7 @@ table {
button, input {
margin-right: @element-margin;
margin-bottom: 0;
}
}

@ -131,9 +131,10 @@
(->> (domain-schema/accessible-schemas!
user-uuid)
(map (fn [schema]
{:form (link-form! (:uuid schema))
:schema schema}))
(forms-inst/bulk-link-form))
{;; :form (link-form! (:uuid schema))
:schema schema
:instances (domain/find-by-schema!
(:uuid schema))})))
req)))
(defn route-create-bulk-link! [uuid req]

@ -16,13 +16,26 @@
(h (:name instance))
[:small " with..."]]
(hform/form-to
{:class "no-grid"}
[:post (path :instance-bulk-link-create instance)]
(anti-forgery-field)
(for [{:keys [schema form]} forms]
[:fieldset
[:legend "Schema " [:strong (-> schema :name h)]]
(form/render-widgets form
nil
req
{:render-anti-forgery-field? false})])
(for [{:keys [schema instances]} forms]
(list
[:h2 "Schema " (h (:name schema))]
[:label
"Link name "
[:input {:name (str "name[" (:uuid schema) "]")}]]
[:table
[:thead
[:tr
[:th "Selection"]
[:th "Name"]]]
[:tbody
(for [{:keys [name uuid]} instances]
[:tr
[:td {:style "text-align: center;"}
[:input {:type "checkbox"
:name (str "instances[" (:uuid schema) "]")
:value uuid}]]
[:td (h name)]])]]))
(hform/submit-button "Link!"))]))

Loading…
Cancel
Save