Copy/paste form together

This commit is contained in:
Eike Kettner
2020-04-19 23:46:46 +02:00
parent ad772c0c25
commit 9b30542974
8 changed files with 275 additions and 36 deletions

View File

@ -8,6 +8,7 @@ module Page.UserSettings.Data exposing
import Comp.ChangePasswordForm
import Comp.EmailSettingsManage
import Comp.NotificationForm
import Data.Flags exposing (Flags)
type alias Model =
@ -18,12 +19,12 @@ type alias Model =
}
emptyModel : Model
emptyModel =
emptyModel : Flags -> Model
emptyModel flags =
{ currentTab = Nothing
, changePassModel = Comp.ChangePasswordForm.emptyModel
, emailSettingsModel = Comp.EmailSettingsManage.emptyModel
, notificationModel = Comp.NotificationForm.init
, notificationModel = Tuple.first (Comp.NotificationForm.init flags)
}
@ -38,3 +39,4 @@ type Msg
| ChangePassMsg Comp.ChangePasswordForm.Msg
| EmailSettingsMsg Comp.EmailSettingsManage.Msg
| NotificationMsg Comp.NotificationForm.Msg
| Init

View File

@ -10,6 +10,14 @@ import Page.UserSettings.Data exposing (..)
update : Flags -> Msg -> Model -> ( Model, Cmd Msg )
update flags msg model =
case msg of
Init ->
let
cmd =
Cmd.map NotificationMsg
(Tuple.second (Comp.NotificationForm.init flags))
in
( model, cmd )
SetTab t ->
let
m =
@ -28,8 +36,12 @@ update flags msg model =
( m, Cmd.none )
NotificationTab ->
-- todo: get initial settings
( m, Cmd.none )
let
initCmd =
Cmd.map NotificationMsg
(Tuple.second (Comp.NotificationForm.init flags))
in
( m, initCmd )
in
( m2, cmd )

View File

@ -88,5 +88,16 @@ viewNotificationForm model =
[ text "Notification"
]
]
, Html.map NotificationMsg (Comp.NotificationForm.view model.notificationModel)
, p []
[ text "Docspell can notify you once the due dates of your items come closer. "
, text "Notification is done via e-mail. You need to provide a connection in "
, text "your e-mail settings."
]
, p []
[ text "Each time this is executed, docspell finds all items that are due in "
, em [] [ text "Remind Days" ]
, text " days."
]
, Html.map NotificationMsg
(Comp.NotificationForm.view "segment" model.notificationModel)
]