mirror of
https://github.com/correl/planning-poker.git
synced 2024-11-22 03:00:12 +00:00
Disable voting once revealed
This commit is contained in:
parent
ae42bccd9c
commit
4e8ac6f8d2
1 changed files with 21 additions and 6 deletions
|
@ -233,7 +233,7 @@ viewRoom device model =
|
|||
column [ width fill, spacing 20 ]
|
||||
[ viewPlayers (Dict.values model.room.players) model.showVotes
|
||||
, el [ width (fillPortion 3), alignTop ] <|
|
||||
viewCards myVote
|
||||
viewCards model myVote
|
||||
, moderatorTools model
|
||||
]
|
||||
|
||||
|
@ -242,7 +242,7 @@ viewRoom device model =
|
|||
[ row
|
||||
[ width fill ]
|
||||
[ el [ width (fillPortion 3), alignTop ] <|
|
||||
viewCards myVote
|
||||
viewCards model myVote
|
||||
, column [ width (fillPortion 1), alignTop, spacing 50 ] <|
|
||||
[ viewPlayers (Dict.values model.room.players) model.showVotes
|
||||
, moderatorTools model
|
||||
|
@ -273,9 +273,19 @@ navBar { title, playerName } =
|
|||
]
|
||||
|
||||
|
||||
viewCards : Maybe String -> Element Msg
|
||||
viewCards selected =
|
||||
viewCards : Model -> Maybe String -> Element Msg
|
||||
viewCards model selected =
|
||||
let
|
||||
enabled =
|
||||
not model.showVotes
|
||||
|
||||
selectedColor =
|
||||
if enabled then
|
||||
UI.colors.selected
|
||||
|
||||
else
|
||||
UI.colors.disabled
|
||||
|
||||
card value =
|
||||
Input.button
|
||||
[ width (px 100)
|
||||
|
@ -287,13 +297,18 @@ viewCards selected =
|
|||
, Border.rounded 10
|
||||
, Background.color <|
|
||||
if selected == Just value then
|
||||
UI.colors.selected
|
||||
selectedColor
|
||||
|
||||
else
|
||||
UI.colors.background
|
||||
, Font.size 50
|
||||
]
|
||||
{ onPress = Just (Vote value)
|
||||
{ onPress =
|
||||
if enabled then
|
||||
Just (Vote value)
|
||||
|
||||
else
|
||||
Nothing
|
||||
, label = el [ centerX, centerY ] (text value)
|
||||
}
|
||||
in
|
||||
|
|
Loading…
Reference in a new issue