.mdl-shadow--2dp

     [:div.mdl-card__title
      [:h4.mdl-card__title-text
       [:i.material-icons
        {:class (if (:passed? result) "passed" "failed")}
        (if (:passed? result) "check_circle_outline" "cancel")]
       [:a.test-name {:name (:expected result)} (:expected result)]]]

     [:div.mdl-card__supporting-text
      [:div.mdl-grid
       [:div.detail.mdl-cell.mdl-cell--6-col
        [:div "Metric: " (get-in result [:target :metric])]
        [:div "Threshold: " (get-in result [:target :metric-threshold])]
        [:div "Result: " (:metric result)]]

       [:div.mdl-cell.mdl-cell--6-col
        [log-gauge
         (get-in result [:target :metric-threshold])
         (:metric result)]]]

      [:div.comparison-titles.mdl-grid
       [:div.mdl-cell.mdl-cell--4-col
        [:h6 "Expected"]]

       [:div.mdl-cell.mdl-cell--4-col
        [:h6 "Difference"]]

       [:div.mdl-cell.mdl-cell--4-col
        [:h6 "Actual"]]]

      [:div.normalisation-chain
       (for [step chain]
         ^{:key (:normalisation step)}
         [normalisation-step step])]

      (let [{:keys [expected actual]} (last chain)
            show-glass? (reagent/atom false)
            cursor-pos (reagent/atom nil)]
        [:div.final-result
         [:h6.step-name.expanded "Result"]
         [:div.comparison.mdl-grid
          [:div.expected.mdl-cell.mdl-cell--4-col
           [image expected cursor-pos show-glass?]]

          [:div.difference.mdl-cell.mdl-cell--4-col
           [image (:difference result) cursor-pos show-glass?]]

          [:div.actual.mdl-cell.mdl-cell--4-col
           [image actual cursor-pos show-glass?]]]])]]))

(defn- test-list [results]
  [:ul.test-list
   (doall (for [{:keys [expected passed?]} results]
            [:li {:key expected
                  :class (if passed? "passed" "failed")}
             [:a {:href (str "#" expected)}
              expected]]))])

(defn- test-summary [results]
  [:div
   [:h4 "Tests"]
   [:div.controls
    "Sort: "
    [:select {:value (name @sort-key)
              :on-change (fn [x]
                           (reset! sort-key (keyword (.-value (.-target x)))))}
     (for [[label value] [["Name" :expected]
                          ["Difference" :metric]]]
       [:option {:key value :value value}
        label])]

    " Failures only: "
    [:label.mdl-switch.is-upgraded
     {:class (when @failures-only? "is-checked")
      :for "failures-only?"}
     [:input.mdl-switch__input {:id "failures-only?"
                                :type "checkbox"
                                :defaultChecked @failures-only?
                                :on-change (fn [x]
                                             (reset! failures-only? (.-checked (.-target x))))}]
     [:div.mdl-switch__track]
     [:div.mdl-switch__thumb
      [:span.mdl-switch__focus-helper]]]]
   [test-list results]])

(defn summary [results]
  [:div.summary.mdl-card.mdl-shadow--2dp
   [:div.mdl-card__title
    [:h2.mdl-card__title-text
     "Summary"]]
   [:div.mdl-card__supporting-text
    [:div.mdl-grid.stats
     [:div.mdl-cell.mdl-cell--4-col
      [:div.headline (count results)] "tests"]
     [:div.passed.mdl-cell.mdl-cell--4-col
      [:div.headline (count (filter :passed? results))]
      [:i.material-icons "check_circle_outline"]
      "passed"]
     [:div.failed.mdl-cell.mdl-cell--4-col
      [:div.headline (count (remove :passed? results))]
      [:i.material-icons "cancel"]
      "failed"]]
    [test-summary results]]])

(defn- floating-menu []
  (let [expanded? (reagent/atom false)]
    (fn [results]
      [:div.floating-menu
       {:on-mouse-leave (fn [] (reset! expanded? false))
        :class (when @expanded? "expanded")}
       [:div.button-container
        {:on-click (fn [] (.scrollTo js/window 0 0))}
        [:div.top-button
         [:i.material-icons "eject"]
         [:span.description "top"]]]
       [:div.button-container
        {:on-click (fn [] (swap! expanded? not))}
        [:div.list-button
         [:i.material-icons "list"]
         [:span.description "tests"]]
        (when @expanded?
          [test-list results])]])))

(defn- kamera-report []
  (let [results @results]
    [:div
     [floating-menu results]
     [:h1.title.mdl-shadow--2dp
      {:class (if (every? :passed? results) "passed" "failed")}
      "kamera"]

     [:div.mdl-grid
      [:div.mdl-cell.mdl-cell--12-col
       [summary results]]

      (doall (for [result results]
               ^{:key (:expected result)}
               [:div.mdl-cell.mdl-cell--12-col
                [test-result result]]))]]))

(defn- mount-app []
  (when app
    (reagent/render [kamera-report] app)))

(defn- load-results! []
  (when-let [r (o/get js/window "results")]
    (->> r read-string (reset! results-store))))

(defn- init []
  (load-results!)
  (mount-app))

(defn ^:after-load on-figwheel-reload []
  (load-results!)
  (mount-app))

(.addEventListener js/document "DOMContentLoaded" init)

;; todo
;; 4. icon / branding in the header
;; 6. display w x h in pixels on each image
;; 7. tests can have names - generate better ones in devcards
;; 8. errors should bubble into the report
Click to read the article
Rate this Movie
What's Love Got to Do With It? (1993)
Tomatometer
How does the Tomatometer work
Reviews Counted: 28
Fresh: 26
Rotten:2
Average Rating: 7.2/10
Synopsis: 17-year old Anna Mae leaves the backwoods of Tennessee for St. Louis to be reunited with her stern mother and elder sister, Alline. One evening, Alline brings Anna Mae to the night club where a.... [More]
Starring: Angela Bassett, Laurence Fishburne, Chi McBride, Cora Lee Day
Starring: Angela Bassett, Laurence Fishburne, Chi McBride, Cora Lee Day, Jenifer Lewis, Khandi Alexander, Pamala Tyson, Penny Johnson, Phyllis Yvonne Stickney, Sherman Augustus, Vanessa Bell Calloway
Director: Brian Gibson
Director: Brian Gibson
Screenwriter: Kate Lanier
Producer: Doug Chapin, Barry Krost
Composer: Stanley Clarke
Get This Movie
Rent DVD
Click on the "ADD" button to put this movie into your Netflix queue.
Buy DVD
Release:
Aug 24, 1999
Reviews for What's Love Got to Do With It?
As Tina Turner, Angela Bassett gives a powerhouse well-deserved Oscar-nominated performance, but the biopic has more than its fair share of showbiz cliches.
Click to read the article
