Last active
October 13, 2015 14:45
-
-
Save BrianHicks/da86586e433daf06c6ab to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
board : Signal.Address Action -> Board -> Bool -> Html | |
board address model selected = | |
li [ key model.id | |
, classList [ ( "board", True ) | |
, ( "selected", selected ) ] ] -- todo: click event | |
[ h2 [ class "title" ] [ text model.name ] | |
, p [] [ text model.desc ]] | |
boards : Signal.Address Action -> Model -> Html | |
boards address model = | |
if List.isEmpty model.boards | |
then div [ class "empty" ] [ text "no boards loaded" ] | |
else ul [ class "boards" ] | |
(List.map (\b -> board address b (isSelected b model.selected)) model.boards) | |
view : Signal.Address Action -> Model -> Html | |
view address model = | |
boards address model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
isSelected : Board -> Maybe ID -> Bool | |
isSelected board id = | |
case id of | |
Nothing -> False | |
Just id -> board.id == id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment