mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-06-22 02:18:26 +00:00
Add imap settings
This commit is contained in:
@ -7,6 +7,7 @@ module Page.UserSettings.Data exposing
|
||||
|
||||
import Comp.ChangePasswordForm
|
||||
import Comp.EmailSettingsManage
|
||||
import Comp.ImapSettingsManage
|
||||
import Comp.NotificationForm
|
||||
import Data.Flags exposing (Flags)
|
||||
|
||||
@ -15,6 +16,7 @@ type alias Model =
|
||||
{ currentTab : Maybe Tab
|
||||
, changePassModel : Comp.ChangePasswordForm.Model
|
||||
, emailSettingsModel : Comp.EmailSettingsManage.Model
|
||||
, imapSettingsModel : Comp.ImapSettingsManage.Model
|
||||
, notificationModel : Comp.NotificationForm.Model
|
||||
}
|
||||
|
||||
@ -24,6 +26,7 @@ emptyModel flags =
|
||||
{ currentTab = Nothing
|
||||
, changePassModel = Comp.ChangePasswordForm.emptyModel
|
||||
, emailSettingsModel = Comp.EmailSettingsManage.emptyModel
|
||||
, imapSettingsModel = Comp.ImapSettingsManage.emptyModel
|
||||
, notificationModel = Tuple.first (Comp.NotificationForm.init flags)
|
||||
}
|
||||
|
||||
@ -31,6 +34,7 @@ emptyModel flags =
|
||||
type Tab
|
||||
= ChangePassTab
|
||||
| EmailSettingsTab
|
||||
| ImapSettingsTab
|
||||
| NotificationTab
|
||||
|
||||
|
||||
@ -39,3 +43,4 @@ type Msg
|
||||
| ChangePassMsg Comp.ChangePasswordForm.Msg
|
||||
| EmailSettingsMsg Comp.EmailSettingsManage.Msg
|
||||
| NotificationMsg Comp.NotificationForm.Msg
|
||||
| ImapSettingsMsg Comp.ImapSettingsManage.Msg
|
||||
|
@ -2,6 +2,7 @@ module Page.UserSettings.Update exposing (update)
|
||||
|
||||
import Comp.ChangePasswordForm
|
||||
import Comp.EmailSettingsManage
|
||||
import Comp.ImapSettingsManage
|
||||
import Comp.NotificationForm
|
||||
import Data.Flags exposing (Flags)
|
||||
import Page.UserSettings.Data exposing (..)
|
||||
@ -24,6 +25,13 @@ update flags msg model =
|
||||
in
|
||||
( { m | emailSettingsModel = em }, Cmd.map EmailSettingsMsg c )
|
||||
|
||||
ImapSettingsTab ->
|
||||
let
|
||||
( em, c ) =
|
||||
Comp.ImapSettingsManage.init flags
|
||||
in
|
||||
( { m | imapSettingsModel = em }, Cmd.map ImapSettingsMsg c )
|
||||
|
||||
ChangePassTab ->
|
||||
( m, Cmd.none )
|
||||
|
||||
@ -51,6 +59,13 @@ update flags msg model =
|
||||
in
|
||||
( { model | emailSettingsModel = m2 }, Cmd.map EmailSettingsMsg c2 )
|
||||
|
||||
ImapSettingsMsg m ->
|
||||
let
|
||||
( m2, c2 ) =
|
||||
Comp.ImapSettingsManage.update flags m model.imapSettingsModel
|
||||
in
|
||||
( { model | imapSettingsModel = m2 }, Cmd.map ImapSettingsMsg c2 )
|
||||
|
||||
NotificationMsg lm ->
|
||||
let
|
||||
( m2, c2 ) =
|
||||
|
@ -2,6 +2,7 @@ module Page.UserSettings.View exposing (view)
|
||||
|
||||
import Comp.ChangePasswordForm
|
||||
import Comp.EmailSettingsManage
|
||||
import Comp.ImapSettingsManage
|
||||
import Comp.NotificationForm
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
@ -20,7 +21,8 @@ view model =
|
||||
, div [ class "ui attached fluid segment" ]
|
||||
[ div [ class "ui fluid vertical secondary menu" ]
|
||||
[ makeTab model ChangePassTab "Change Password" "user secret icon"
|
||||
, makeTab model EmailSettingsTab "E-Mail Settings" "mail icon"
|
||||
, makeTab model EmailSettingsTab "E-Mail Settings (SMTP)" "mail icon"
|
||||
, makeTab model ImapSettingsTab "E-Mail Settings (IMAP)" "mail icon"
|
||||
, makeTab model NotificationTab "Notifications" "bullhorn icon"
|
||||
]
|
||||
]
|
||||
@ -37,6 +39,9 @@ view model =
|
||||
Just NotificationTab ->
|
||||
viewNotificationForm model
|
||||
|
||||
Just ImapSettingsTab ->
|
||||
viewImapSettings model
|
||||
|
||||
Nothing ->
|
||||
[]
|
||||
)
|
||||
@ -61,13 +66,25 @@ viewEmailSettings model =
|
||||
[ h2 [ class "ui header" ]
|
||||
[ i [ class "mail icon" ] []
|
||||
, div [ class "content" ]
|
||||
[ text "E-Mail Settings"
|
||||
[ text "E-Mail Settings (Smtp)"
|
||||
]
|
||||
]
|
||||
, Html.map EmailSettingsMsg (Comp.EmailSettingsManage.view model.emailSettingsModel)
|
||||
]
|
||||
|
||||
|
||||
viewImapSettings : Model -> List (Html Msg)
|
||||
viewImapSettings model =
|
||||
[ h2 [ class "ui header" ]
|
||||
[ i [ class "mail icon" ] []
|
||||
, div [ class "content" ]
|
||||
[ text "E-Mail Settings (Imap)"
|
||||
]
|
||||
]
|
||||
, Html.map ImapSettingsMsg (Comp.ImapSettingsManage.view model.imapSettingsModel)
|
||||
]
|
||||
|
||||
|
||||
viewChangePassword : Model -> List (Html Msg)
|
||||
viewChangePassword model =
|
||||
[ h2 [ class "ui header" ]
|
||||
|
Reference in New Issue
Block a user