little fixes

This commit is contained in:
2019-12-04 22:29:05 +01:00
parent b00d26e6d4
commit ced3f5763c
3 changed files with 30 additions and 21 deletions

View File

@@ -118,22 +118,10 @@ view page =
( title ( title
, { title = navbarTitle, links = navbarLinks } , { title = navbarTitle, links = navbarLinks }
, [ div [ class "container" ] <| , [ div [ class "container" ] <|
viewSessionBar (maybeSession page) [ controls ] [ viewSessionBar (maybeSession page) [ controls ]
:: div [ class "section" ] , div [ class "section" ]
[ case Maybe.map Session.notification (maybeSession page) of content
Just (Just t) -> ]
viewNotification NotifySuccess t
_ ->
text ""
, case Maybe.map Session.error (maybeSession page) of
Just (Just t) ->
viewNotification NotifyError t
_ ->
text ""
]
:: content
] ]
) )
@@ -153,8 +141,12 @@ viewNotification kind content =
NotifyError -> NotifyError ->
"is-danger" "is-danger"
in in
div [ class ("notification " ++ className) ] div [ class "level-item" ]
[ text content ] [ span [ class ("tag " ++ className) ]
[ text content
, a [ class "delete" ] []
]
]
viewSessionBar session controls = viewSessionBar session controls =
@@ -183,10 +175,25 @@ viewSessionBar session controls =
Just Session.Admin -> Just Session.Admin ->
[ text "Admin" ] [ text "Admin" ]
notifications =
[ case Maybe.map Session.notification session of
Just (Just t) ->
viewNotification NotifySuccess t
_ ->
text ""
, case Maybe.map Session.error session of
Just (Just t) ->
viewNotification NotifyError t
_ ->
text ""
]
in in
section [ class "hero is-dark is-bold" ] section [ class "hero is-dark is-bold" ]
[ div [ class "hero-body" ] [ div [ class "hero-body" ]
[ renderLevel user controls ] [ renderLevel user (notifications ++ controls) ]
] ]

View File

@@ -77,7 +77,7 @@ view model =
button button
[ class "button" [ class "button"
, onClick , onClick
(GotChestMsg <| Chest.showWithClaims (getClaimsFromSession model.session)) (GotChestMsg <| Chest.claim (getClaimsFromSession model.session))
] ]
[ text "Demander" ] [ text "Demander" ]

View File

@@ -26,7 +26,9 @@ view wealth model =
Edit amount -> Edit amount ->
viewUpdateWealth amount viewUpdateWealth amount
) )
++ [ span [ class "icon", onClick StartEdit ] [ i [ class "fas fa-tools" ] [] ] ] ++ [ div [ class "level-item" ]
[ span [ class "icon", onClick StartEdit ] [ i [ class "fas fa-tools" ] [] ] ]
]
viewUpdateWealth amount = viewUpdateWealth amount =