Skip to content

Instantly share code, notes, and snippets.

@trikitrok
Last active January 2, 2019 15:34
Show Gist options
  • Select an option

  • Save trikitrok/14ba88c994be3187ccbca170fca86d91 to your computer and use it in GitHub Desktop.

Select an option

Save trikitrok/14ba88c994be3187ccbca170fca86d91 to your computer and use it in GitHub Desktop.
(ns horizon.desktop.reports.dialogs.edit.settings.scheduling-section
(:require
[greenpowermonitor.re-om :as re-om]
[horizon.common.i18n.core :refer [i18n]]
[horizon.controls.utils.css-transitions-group :as css-transitions-group]
;; ...
[horizon.domain.reports.dialogs.edit :as domain.reports.dialogs.edit]
[om.core :as om :include-macros true]
[sablono.core :refer-macros [html]]))
(defn main-view [_ owner]
(om/component
(html
(let [scheduling? (re-om/subscribe [::domain.reports.dialogs.edit/field ::scheduling?] owner)]
[:div.form-dialog__section.form-dialog__section--centered
[:div.form-dialog__switch
;; ...
]
[:div.form-dialog__title
[:strong (i18n ::scheduling-title)]]
(css-transitions-group/with-transition
:collapsible-card
(when scheduling?
(html
[:div
[:div.form-dialog__subtitle
;; ...
]
[:table.form-dialog__field-group
;; ...
]
(when-let [next-generation (re-om/subscribe
[::domain.reports.dialogs.edit/next-generation-date
(i18n ::next-generation-date-format :format-vals [])
{:delay-generation-number ::delay-generation-number
:delay-generation-unit ::delay-generation-unit
:start-at ::start-at}]
owner)]
[:div.reports-edition-dialog__next-generation
[:p
(i18n ::next-generation) " "
[:strong next-generation] " (UTC)"]])])))]))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment