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

View File

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

View File

@@ -26,7 +26,9 @@ view wealth model =
Edit 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 =