|  |  |  | @ -3,11 +3,15 @@ | 
		
	
		
			
				|  |  |  |  |             [hiccup.core :refer [h]] | 
		
	
		
			
				|  |  |  |  |             [wanijo.infrastructure.view :as view] | 
		
	
		
			
				|  |  |  |  |             [wanijo.infrastructure.routing :refer [path]] | 
		
	
		
			
				|  |  |  |  |             [wanijo.infrastructure.time :refer [prettify-dt]] | 
		
	
		
			
				|  |  |  |  |             [wanijo.instance.view.view | 
		
	
		
			
				|  |  |  |  |              :refer [req-attrs-headings | 
		
	
		
			
				|  |  |  |  |                      req-attrs-cells | 
		
	
		
			
				|  |  |  |  |                      tags-for-search]] | 
		
	
		
			
				|  |  |  |  |             [formulare.core :as form] | 
		
	
		
			
				|  |  |  |  |             [ring.util.anti-forgery :refer [anti-forgery-field]])) | 
		
	
		
			
				|  |  |  |  | 
 | 
		
	
		
			
				|  |  |  |  | (defn bulk-link-selection [instance forms req] | 
		
	
		
			
				|  |  |  |  |   (clojure.pprint/pprint forms) | 
		
	
		
			
				|  |  |  |  |   (view/layout | 
		
	
		
			
				|  |  |  |  |    :request req | 
		
	
		
			
				|  |  |  |  |    :content | 
		
	
	
		
			
				
					|  |  |  | @ -22,20 +26,29 @@ | 
		
	
		
			
				|  |  |  |  |      (for [{:keys [schema instances]} forms] | 
		
	
		
			
				|  |  |  |  |        (list | 
		
	
		
			
				|  |  |  |  |         [:h2 "Schema " (h (:name schema))] | 
		
	
		
			
				|  |  |  |  |         [:label | 
		
	
		
			
				|  |  |  |  |          "Link name " | 
		
	
		
			
				|  |  |  |  |          [:input {:name (str "name[" (:uuid schema) "]")}]] | 
		
	
		
			
				|  |  |  |  |         (let [ident (str "name[" (:uuid schema) "]")] | 
		
	
		
			
				|  |  |  |  |           [:div.sub-form | 
		
	
		
			
				|  |  |  |  |            [:label {:for ident} | 
		
	
		
			
				|  |  |  |  |             "Link name"] | 
		
	
		
			
				|  |  |  |  |            [:input {:name ident :id ident}]]) | 
		
	
		
			
				|  |  |  |  |         [:table | 
		
	
		
			
				|  |  |  |  |          [:thead | 
		
	
		
			
				|  |  |  |  |           [:tr | 
		
	
		
			
				|  |  |  |  |            [:th "Selection"] | 
		
	
		
			
				|  |  |  |  |            [:th "Name"]]] | 
		
	
		
			
				|  |  |  |  |            [:th "Name"] | 
		
	
		
			
				|  |  |  |  |            (req-attrs-headings schema) | 
		
	
		
			
				|  |  |  |  |            [:th "Updated"] | 
		
	
		
			
				|  |  |  |  |            [:th "Created"]]] | 
		
	
		
			
				|  |  |  |  |          [:tbody | 
		
	
		
			
				|  |  |  |  |           (for [{:keys [name uuid]} instances] | 
		
	
		
			
				|  |  |  |  |           (for [inst instances] | 
		
	
		
			
				|  |  |  |  |             [:tr | 
		
	
		
			
				|  |  |  |  |              [:td {:style "text-align: center;"} | 
		
	
		
			
				|  |  |  |  |               [:input {:type "checkbox" | 
		
	
		
			
				|  |  |  |  |                        :name (str "instances[" (:uuid schema) "]") | 
		
	
		
			
				|  |  |  |  |                        :value uuid}]] | 
		
	
		
			
				|  |  |  |  |              [:td (h name)]])]])) | 
		
	
		
			
				|  |  |  |  |                        :value (:uuid inst)}]] | 
		
	
		
			
				|  |  |  |  |              [:td (h (:name inst)) | 
		
	
		
			
				|  |  |  |  |               (tags-for-search inst)] | 
		
	
		
			
				|  |  |  |  |              (req-attrs-cells schema inst) | 
		
	
		
			
				|  |  |  |  |              [:td (-> inst :updated_at prettify-dt)] | 
		
	
		
			
				|  |  |  |  |              [:td (-> inst :created_at prettify-dt)]])]])) | 
		
	
		
			
				|  |  |  |  |      (hform/submit-button "Link!"))])) | 
		
	
	
		
			
				
					|  |  |  | 
 |