Skip to content

Commit

Permalink
Merge pull request #120 from miyamoen/fix/remove-if-no-oauth
Browse files Browse the repository at this point in the history
Remove oauth form if no oauth config.
  • Loading branch information
kkasai authored Jul 14, 2017
2 parents dfeaf7a + 6b462fa commit 6eefb29
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/cljs/job_streamer/console/components/root.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,16 @@
(let [password (.. js/document (getElementById "password") -value)]
(om/set-state! owner :password password)))}]]]
[:button.ui.fluid.large.teal.submit.button{:type "submit"} "Login"]]]]]
[:div.row
[:div.column
[:div.ui.stacked.segments
(for [[id {:keys [name class-name]}] oauth-providers]
[:div.ui.segment
[:button.ui.fluid.large.button {:class (or class-name "teal")
:on-click (fn [e]
(.preventDefault e)
(set! (.-href js/location) (api/url-for (str "/oauth/" id))))}
[:i.icon {:class (or class-name "openid")}]
(str "Login using " name)]])]]]]]])))
(when (not-empty oauth-providers)
[:div.row
[:div.column
[:div.ui.stacked.segments
(for [[id {:keys [name class-name]}] oauth-providers]
[:div.ui.segment
[:button.ui.fluid.large.button {:class (or class-name "teal")
:on-click (fn [e]
(.preventDefault e)
(set! (.-href js/location) (api/url-for (str "/oauth/" id))))}
[:i.icon {:class (or class-name "openid")}]
(str "Login using " name)]])]]])]]])))

0 comments on commit 6eefb29

Please sign in to comment.