mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Copy/paste form together
This commit is contained in:
@ -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
|
||||
|
@ -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 )
|
||||
|
||||
|
@ -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)
|
||||
]
|
||||
|
Reference in New Issue
Block a user