        (build-status-badge build)]
 
 
-      ;; These two cases should be mutually exclusive. Just in case they aren't,
-      ;; use a cond so it doesn't try to render both in the same place
+      ;; Actions should be mutually exclusive. Just in case they
+      ;; aren't, use a cond so it doesn't try to render both in the
+      ;; same place
       (cond
-        (build-model/can-cancel? build)
+        should-show-cancel?
         (build-action
           {:text "cancel"
            :loading-text "Cancelling..."

                                                                             :org (:username build)}})}
            (build-model/github-revision build)])]]]]))

(defn builds-table [{:keys [builds]} owner {:keys [show-actions? show-branch? show-project?]
                                            :or {show-branch? true
                                                 show-project? true}}]
  (reify
    om/IDisplayName (display-name [_] "Builds Table V2")
    om/IRender
    (render [_]
      (html
        [:div.container-fluid
         (map #(build-row % owner {:show-actions? show-actions?
                                   :show-branch? show-branch?
                                   :show-project? show-project?})
              builds)]))))

        icon-class [:i.button-icon {:class icon-class}])
      [:span.button-text text]])])

(defn build-row [{:keys [build project]} owner {:keys [show-actions? show-branch? show-project?]}]
  (let [url (build-model/path-for (select-keys build [:vcs_url]) build)
        raise-build-action! (fn [event] (raise! owner [event (build-model/build-args build)]))
        raise-merge-action! (fn [] (raise! owner [:merge-pull-request-clicked (build-model/merge-args build)]))
        status-words (build-model/status-words build)
        should-show-cancel? (and (project-model/can-trigger-builds? project)
                                 (build-model/can-cancel? build))
        should-show-rebuild? (and (project-model/can-trigger-builds? project)
                                  (#{"timedout" "failed"} (:outcome build)))
        should-show-merge? (and (feature/enabled? :merge-pull-request)
                                (project-model/can-write-settings? project)
                                (build-model/can-merge-at-least-one-pr? build))]
    [:div.build {:class (cond-> [(build-model/status-class build)]
                          (:dont_build build) (conj "dont_build"))}
