Dashboard page template

This commit is contained in:
eikek
2022-01-26 21:21:01 +01:00
parent c38ab3ef82
commit e6775f77dc
11 changed files with 182 additions and 7 deletions

View 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

View 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 )

View 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 [] []

View File

@@ -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 = "" }