50 lines
929 B
Elm
50 lines
929 B
Elm
module Page.Dashboard exposing (Model, Msg, init, update, view)
|
|
|
|
import Html exposing (..)
|
|
import Html.Attributes exposing (..)
|
|
import Html.Events exposing (..)
|
|
import Page.Chest as Chest exposing (Chest)
|
|
import Session exposing (Session)
|
|
|
|
|
|
type alias Model =
|
|
{ session : Session
|
|
, chest : Mode
|
|
}
|
|
|
|
|
|
type Mode
|
|
= View Chest
|
|
|
|
|
|
init : Session -> ( Model, Cmd Msg )
|
|
init session =
|
|
( Model session (View Chest.init)
|
|
, Cmd.none
|
|
)
|
|
|
|
|
|
view : Model -> ( Html Msg, List (Html Msg) )
|
|
view model =
|
|
case Session.user model.session of
|
|
Session.Player player _ ->
|
|
( text ""
|
|
, [ if player.id == 0 then
|
|
p [] [ text "Groupe" ]
|
|
|
|
else
|
|
p [] [ text "Joueur" ]
|
|
]
|
|
)
|
|
|
|
Session.Admin ->
|
|
( text "", [ p [] [ text "Joueur" ] ] )
|
|
|
|
|
|
type Msg
|
|
= Msg
|
|
|
|
|
|
update msg model =
|
|
( model, Cmd.none )
|