mirror of
https://github.com/correl/planning-poker.git
synced 2024-11-24 19:19:53 +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 ]
|
column [ width fill, spacing 20 ]
|
||||||
[ viewPlayers (Dict.values model.room.players) model.showVotes
|
[ viewPlayers (Dict.values model.room.players) model.showVotes
|
||||||
, el [ width (fillPortion 3), alignTop ] <|
|
, el [ width (fillPortion 3), alignTop ] <|
|
||||||
viewCards myVote
|
viewCards model myVote
|
||||||
, moderatorTools model
|
, moderatorTools model
|
||||||
]
|
]
|
||||||
|
|
||||||
|
@ -242,7 +242,7 @@ viewRoom device model =
|
||||||
[ row
|
[ row
|
||||||
[ width fill ]
|
[ width fill ]
|
||||||
[ el [ width (fillPortion 3), alignTop ] <|
|
[ el [ width (fillPortion 3), alignTop ] <|
|
||||||
viewCards myVote
|
viewCards model myVote
|
||||||
, column [ width (fillPortion 1), alignTop, spacing 50 ] <|
|
, column [ width (fillPortion 1), alignTop, spacing 50 ] <|
|
||||||
[ viewPlayers (Dict.values model.room.players) model.showVotes
|
[ viewPlayers (Dict.values model.room.players) model.showVotes
|
||||||
, moderatorTools model
|
, moderatorTools model
|
||||||
|
@ -273,9 +273,19 @@ navBar { title, playerName } =
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
viewCards : Maybe String -> Element Msg
|
viewCards : Model -> Maybe String -> Element Msg
|
||||||
viewCards selected =
|
viewCards model selected =
|
||||||
let
|
let
|
||||||
|
enabled =
|
||||||
|
not model.showVotes
|
||||||
|
|
||||||
|
selectedColor =
|
||||||
|
if enabled then
|
||||||
|
UI.colors.selected
|
||||||
|
|
||||||
|
else
|
||||||
|
UI.colors.disabled
|
||||||
|
|
||||||
card value =
|
card value =
|
||||||
Input.button
|
Input.button
|
||||||
[ width (px 100)
|
[ width (px 100)
|
||||||
|
@ -287,13 +297,18 @@ viewCards selected =
|
||||||
, Border.rounded 10
|
, Border.rounded 10
|
||||||
, Background.color <|
|
, Background.color <|
|
||||||
if selected == Just value then
|
if selected == Just value then
|
||||||
UI.colors.selected
|
selectedColor
|
||||||
|
|
||||||
else
|
else
|
||||||
UI.colors.background
|
UI.colors.background
|
||||||
, Font.size 50
|
, Font.size 50
|
||||||
]
|
]
|
||||||
{ onPress = Just (Vote value)
|
{ onPress =
|
||||||
|
if enabled then
|
||||||
|
Just (Vote value)
|
||||||
|
|
||||||
|
else
|
||||||
|
Nothing
|
||||||
, label = el [ centerX, centerY ] (text value)
|
, label = el [ centerX, centerY ] (text value)
|
||||||
}
|
}
|
||||||
in
|
in
|
||||||
|
|
Loading…
Reference in a new issue