github.com/pf-qiu/concourse/v6@v6.7.3-0.20201207032516-1f455d73275f/web/elm/src/Views/DictView.elm (about) 1 module Views.DictView exposing (view) 2 3 import Dict exposing (Dict) 4 import Html exposing (Html) 5 import Html.Attributes exposing (class) 6 7 8 view : List (Html.Attribute a) -> Dict String (Html a) -> Html a 9 view attrs dict = 10 Html.table (class "dictionary" :: attrs) <| 11 List.map viewPair (Dict.toList dict) 12 13 14 viewPair : ( String, Html a ) -> Html a 15 viewPair ( name, value ) = 16 Html.tr [] 17 [ Html.td [ class "dict-key" ] [ Html.text name ] 18 , Html.td [ class "dict-value" ] [ value ] 19 ]