adds filter text input, add player for admin

This commit is contained in:
2019-12-18 15:27:13 +01:00
parent 1636248686
commit 90bad7e481
6 changed files with 193 additions and 111 deletions

View File

@@ -71,12 +71,12 @@ view model =
( True, data.player.id == 0 )
in
case ( model.chest, isPlayer && not isGroup ) of
( Chest.View _, True ) ->
( Chest.View _ _, True ) ->
B.btn
(GotChestMsg <| Chest.claim (getClaimsFromSession model.session))
{ text = "Demander", icon = "fas fa-praying-hands", color = "is-primary" }
( Chest.Claim _, True ) ->
( Chest.Claim _ _, True ) ->
B.confirmButtons ConfirmGrab (GotChestMsg Chest.show)
( _, _ ) ->
@@ -93,7 +93,7 @@ type Msg
type InnerMsg
= GotLoot Api.ToChest (HttpResult Loot)
= GotLoot (HttpResult Loot)
| GotChestMsg Chest.Msg
| ConfirmGrab
@@ -106,7 +106,7 @@ update msg model =
Internal ConfirmGrab ->
case ( Session.user model.session, model.loot, model.chest ) of
( Player data, Loaded loot, Chest.Claim _ ) ->
( Player data, Loaded loot, Chest.Claim _ _ ) ->
( model
, Chest.confirmGrab
data.player.id
@@ -121,11 +121,11 @@ update msg model =
Internal innerMsg ->
Tuple.mapSecond (Cmd.map Internal) <|
case innerMsg of
GotLoot _ (Ok loot) ->
GotLoot (Ok loot) ->
( { model | loot = Loaded loot }, Cmd.none )
GotLoot _ (Err _) ->
( { model | loot = LoadError "Le chargement a échoué" }, Cmd.none )
GotLoot (Err e) ->
( { model | loot = LoadError <| Debug.toString e }, Cmd.none )
GotChestMsg chestMsg ->
Chest.update chestMsg model.chest