        [:h4.rules_summary_title
         (str "Conditions in this form (" (count conditions) ")")]
        [:ul.unstyled.global
-        (om/build-all condition-detail conditions)]])))
+        (let [grouped-conditions (group-by :master-field conditions)]
+          (for [[master-field conditions] grouped-conditions]
+            (om/build condition-group {:master-field master-field
+                                       :conditions conditions})))]])))
 
 
 (defn remove-condition

(defcomponent condition-detail [condition owner]
  (render-state [_ state]
    (let [{:keys [master-field field-value slave-fields]} condition]
      (html [:li.rule {:data-id (:id master-field)}
             [:div.ruleTitle
              [:i.icon-arrow-right]
              [:a.field

                                     :new-value           master-field})))}
               (:name master-field)]]
             [:ul.unstyled
              (om/build-all condition-detail conditions)]])))



