Add user setting page for totp

This commit is contained in:
eikek
2021-08-30 23:54:37 +02:00
parent 309a52393a
commit 999c39833a
7 changed files with 648 additions and 1 deletions

View File

@ -11,6 +11,7 @@ import Comp.ChangePasswordForm
import Comp.EmailSettingsManage
import Comp.ImapSettingsManage
import Comp.NotificationManage
import Comp.OtpSetup
import Comp.ScanMailboxManage
import Comp.UiSettingsManage
import Data.Flags exposing (Flags)
@ -104,6 +105,17 @@ viewSidebar texts visible _ _ model =
[ class "ml-3" ]
[ text texts.changePassword ]
]
, a
[ href "#"
, onClick (SetTab OtpTab)
, menuEntryActive model OtpTab
, class S.sidebarLink
]
[ i [ class "fa fa-key" ] []
, span
[ class "ml-3" ]
[ text texts.otpMenu ]
]
]
]
@ -133,6 +145,9 @@ viewContent texts flags settings model =
Just UiSettingsTab ->
viewUiSettings texts flags settings model
Just OtpTab ->
viewOtpSetup texts settings model
Nothing ->
[]
)
@ -151,6 +166,25 @@ menuEntryActive model tab =
class ""
viewOtpSetup : Texts -> UiSettings -> Model -> List (Html Msg)
viewOtpSetup texts _ model =
[ h2
[ class S.header1
, class "inline-flex items-center"
]
[ i [ class "fa fa-key" ] []
, div [ class "ml-3" ]
[ text texts.otpMenu
]
]
, Html.map OtpSetupMsg
(Comp.OtpSetup.view
texts.otpSetup
model.otpSetupModel
)
]
viewChangePassword : Texts -> Model -> List (Html Msg)
viewChangePassword texts model =
[ h2