mirror of
https://github.com/TheAnachronism/docspell.git
synced 2025-09-30 00:28:23 +00:00
Dashboard page template
This commit is contained in:
27
modules/webapp/src/main/elm/Page/Dashboard/Data.elm
Normal file
27
modules/webapp/src/main/elm/Page/Dashboard/Data.elm
Normal file
@@ -0,0 +1,27 @@
|
||||
{-
|
||||
Copyright 2020 Eike K. & Contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-}
|
||||
|
||||
|
||||
module Page.Dashboard.Data exposing
|
||||
( Model
|
||||
, Msg(..)
|
||||
, init
|
||||
)
|
||||
|
||||
import Data.Flags exposing (Flags)
|
||||
|
||||
|
||||
type alias Model =
|
||||
{}
|
||||
|
||||
|
||||
init : Flags -> ( Model, Cmd Msg )
|
||||
init flags =
|
||||
( {}, Cmd.none )
|
||||
|
||||
|
||||
type Msg
|
||||
= Init
|
18
modules/webapp/src/main/elm/Page/Dashboard/Update.elm
Normal file
18
modules/webapp/src/main/elm/Page/Dashboard/Update.elm
Normal file
@@ -0,0 +1,18 @@
|
||||
{-
|
||||
Copyright 2020 Eike K. & Contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-}
|
||||
|
||||
|
||||
module Page.Dashboard.Update exposing (update)
|
||||
|
||||
import Data.Flags exposing (Flags)
|
||||
import Page.Dashboard.Data exposing (..)
|
||||
|
||||
|
||||
update : Flags -> Msg -> Model -> ( Model, Cmd Msg )
|
||||
update flags msg model =
|
||||
case msg of
|
||||
Init ->
|
||||
( model, Cmd.none )
|
38
modules/webapp/src/main/elm/Page/Dashboard/View.elm
Normal file
38
modules/webapp/src/main/elm/Page/Dashboard/View.elm
Normal file
@@ -0,0 +1,38 @@
|
||||
{-
|
||||
Copyright 2020 Eike K. & Contributors
|
||||
|
||||
SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
-}
|
||||
|
||||
|
||||
module Page.Dashboard.View exposing (viewContent, viewSidebar)
|
||||
|
||||
import Data.Flags exposing (Flags)
|
||||
import Data.UiSettings exposing (UiSettings)
|
||||
import Html exposing (..)
|
||||
import Html.Attributes exposing (..)
|
||||
import Html.Events exposing (onClick)
|
||||
import Messages.Page.Dashboard exposing (Texts)
|
||||
import Page.Dashboard.Data exposing (..)
|
||||
import Styles as S
|
||||
|
||||
|
||||
viewSidebar : Texts -> Bool -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewSidebar texts visible _ _ model =
|
||||
div
|
||||
[ id "sidebar"
|
||||
, class S.sidebar
|
||||
, class S.sidebarBg
|
||||
, classList [ ( "hidden", not visible ) ]
|
||||
]
|
||||
[ div [ class "" ]
|
||||
[ h1 [ class S.header1 ]
|
||||
[ text "sidebar"
|
||||
]
|
||||
]
|
||||
]
|
||||
|
||||
|
||||
viewContent : Texts -> Flags -> UiSettings -> Model -> Html Msg
|
||||
viewContent texts _ _ model =
|
||||
div [] []
|
@@ -53,7 +53,7 @@ update loginData flags msg model =
|
||||
AuthResp (Ok lr) ->
|
||||
let
|
||||
gotoRef =
|
||||
Maybe.withDefault SearchPage loginData.referrer |> Page.goto
|
||||
Maybe.withDefault DashboardPage loginData.referrer |> Page.goto
|
||||
in
|
||||
if lr.success && not lr.requireSecondFactor then
|
||||
( { model | formState = AuthSuccess lr, password = "" }
|
||||
|
Reference in New Issue
Block a user