Skip to content

Instantly share code, notes, and snippets.

@mbertheau
Created September 9, 2015 04:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mbertheau/6f7debba1a8943930c13 to your computer and use it in GitHub Desktop.
Save mbertheau/6f7debba1a8943930c13 to your computer and use it in GitHub Desktop.
(defn progress-visualization:c [normal-progress overtime-progress text]
(let [normal-bar [:div.progress-bar.progress-bar-success
(let [base-style {:style {:width (str normal-progress "%")}}
final-style (if overtime-progress
base-style
(assoc base-style :class "progress-bar-striped"))]
final-style) text]]
(if overtime-progress
[normal-bar
[:div.progress-bar.progress-bar-warning.progress-bar-striped
{:style {:width (str overtime-progress "%")}}]]
[normal-bar])))
@mbertheau
Copy link
Author

(defn progress-visualization:c [normal-progress overtime-progress text]
  (let [base-style {:style {:width (str normal-progress "%")}}
        final-style (if overtime-progress
                      base-style
                      (assoc base-style :class "progress-bar-striped"))
        normal-bar [:div.progress-bar.progress-bar-success
                    final-style text]]
    (if overtime-progress
      [normal-bar
        [:div.progress-bar.progress-bar-warning.progress-bar-striped
         {:style {:width (str overtime-progress "%")}}]]
      [normal-bar])))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment