aboutsummaryrefslogtreecommitdiff
path: root/src/client/Model.elm
diff options
context:
space:
mode:
authorJoris2017-09-24 22:14:48 +0200
committerJoris2017-11-07 09:33:01 +0100
commit898e7ed11ab0958fcdaf65b99b33f7b04787630a (patch)
tree8b5ab951c36d7d27550a7c4eaad16bbd2cd0edb1 /src/client/Model.elm
parent14bdbc8c937f5d0b35c61350dba28cb41c3737cd (diff)
downloadbudget-898e7ed11ab0958fcdaf65b99b33f7b04787630a.tar.gz
budget-898e7ed11ab0958fcdaf65b99b33f7b04787630a.tar.bz2
budget-898e7ed11ab0958fcdaf65b99b33f7b04787630a.zip
Bootstrap with GHCJS and reflex:
- setup login and logout, - first draft of payment view.
Diffstat (limited to 'src/client/Model.elm')
-rw-r--r--src/client/Model.elm72
1 files changed, 0 insertions, 72 deletions
diff --git a/src/client/Model.elm b/src/client/Model.elm
deleted file mode 100644
index 7f62416..0000000
--- a/src/client/Model.elm
+++ /dev/null
@@ -1,72 +0,0 @@
-module Model exposing
- ( Model
- , init
- )
-
-import Time exposing (Time)
-import Json.Decode as Decode
-
-import Navigation exposing (Location)
-
-import Html as Html
-
-import Page exposing (Page)
-import Init as Init exposing (Init)
-import Msg exposing (Msg)
-
-import Model.View exposing (..)
-import Model.Translations exposing (..)
-import Model.Conf exposing (..)
-import Model.InitResult exposing (..)
-import LoggedIn.Model as LoggedInModel
-import SignIn.Model as SignInModel
-
-import Dialog
-import Dialog.Model as DialogModel
-import Dialog.Msg as DialogMsg
-
-import Tooltip
-
-type alias Model =
- { view : View
- , currentTime : Time
- , translations : Translations
- , conf : Conf
- , page : Page
- , errors : List String
- , dialog : Dialog.Model DialogModel.Model DialogMsg.Msg Msg
- , tooltip : Tooltip.Model
- }
-
-init : Decode.Value -> Location -> (Model, Cmd Msg)
-init payload location =
- let model =
- case Decode.decodeValue Init.decoder payload of
- Ok { time, translations, conf, result, windowSize } ->
- { view =
- case result of
- InitEmpty ->
- SignInView (SignInModel.init Nothing)
- InitSuccess init ->
- LoggedInView (LoggedInModel.init time init)
- InitError error ->
- SignInView (SignInModel.init (Just error))
- , currentTime = time
- , translations = translations
- , conf = conf
- , page = Page.fromLocation location
- , errors = []
- , dialog = Dialog.init DialogModel.init Msg.Dialog
- , tooltip = Tooltip.init windowSize.width windowSize.height
- }
- Err error ->
- { view = SignInView (SignInModel.init (Just error))
- , currentTime = 0
- , translations = []
- , conf = { currency = "" }
- , page = Page.fromLocation location
- , errors = [ error ]
- , dialog = Dialog.init DialogModel.init Msg.Dialog
- , tooltip = Tooltip.init 0 0
- }
- in (model, Cmd.none)