diff options
author | Joris | 2016-03-27 19:44:40 +0200 |
---|---|---|
committer | Joris | 2016-03-27 19:44:40 +0200 |
commit | 5f6c66e4c3cf02e5b1c0a1fac6036b86be06a992 (patch) | |
tree | 510b3b65d13a8003b092b4c9fe62f6456750cd38 /src/client/elm/View | |
parent | 9b7546b99411a8364eccf6b0262a3c0c7d82380c (diff) |
Regroup signIn modules
Diffstat (limited to 'src/client/elm/View')
-rw-r--r-- | src/client/elm/View/SignIn.elm | 62 |
1 files changed, 0 insertions, 62 deletions
diff --git a/src/client/elm/View/SignIn.elm b/src/client/elm/View/SignIn.elm deleted file mode 100644 index acff960..0000000 --- a/src/client/elm/View/SignIn.elm +++ /dev/null @@ -1,62 +0,0 @@ -module View.SignIn - ( renderSignIn - ) where - -import Html as H exposing (..) -import Html.Attributes exposing (..) -import Html.Events exposing (..) -import Signal exposing (Address) -import Json.Decode as Json - -import Update exposing (..) -import Update.SignIn exposing (..) - -import Model exposing (Model) -import Model.Action exposing (..) -import Model.Action.SignInAction exposing (..) -import Model.View.SignInView exposing (..) -import Model.Translations exposing (getMessage) - -import View.Events exposing (onSubmitPrevDefault) -import View.Icon exposing (renderSpinIcon) - -renderSignIn : Address Action -> Model -> SignInView -> Html -renderSignIn address model signInView = - div - [ class "signIn" ] - [ H.form - [ onSubmitPrevDefault address (SignIn signInView.login) ] - [ input - [ value signInView.login - , on "input" targetValue (Signal.message address << UpdateSignIn << UpdateLogin) - , type' "text" - , autocomplete True - ] - [] - , button - [] - [ if signInView.waitingServer - then renderSpinIcon - else text (getMessage "SignIn" model.translations) - ] - ] - , div - [ class "result" ] - [ signInResult model signInView ] - ] - -signInResult : Model -> SignInView -> Html -signInResult model signInView = - case signInView.result of - Just result -> - case result of - Ok login -> - div - [ class "success" ] - [ text (getMessage "SignInEmailSent" model.translations) ] - Err error -> - div - [ class "error" ] - [ text (getMessage error model.translations) ] - Nothing -> - text "" |