From 973a039b54327df74396605410ea9abe19c8a4e7 Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 4 Sep 2016 21:21:11 +0200 Subject: Upgrade to elm 0.17.1 --- src/View.elm | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 src/View.elm (limited to 'src/View.elm') diff --git a/src/View.elm b/src/View.elm new file mode 100644 index 0000000..5b3ad8d --- /dev/null +++ b/src/View.elm @@ -0,0 +1,56 @@ +module View exposing + ( view + ) + +import Html exposing (..) +import Html.Attributes exposing (..) +import Html.Events exposing (..) +import List +import Dict +import Json.Decode as Json + +import Msg exposing (Msg) + +import Model exposing (..) +import Model.Id exposing (..) + +import Timer.Model exposing (..) +import Timer.View as Timer + +import Update exposing (..) + +view : Model -> Html Msg +view model = + div + [] + [ title + , model.timers + |> Dict.toList + |> List.sortBy (.creationTime << snd) + |> timers model + ] + +title : Html Msg +title = + div + [ class "headerBar" ] + [ button + [ onClick Msg.Initialize + , class "title" + ] + [ text "Timer" ] + , button + [ onClick Msg.AddNewTimer + , class "addTimer" + ] + [ i + [ class "fa fa-fw fa-plus" ] + [] + ] + ] + +timers : Model -> List (Id, Timer) -> Html Msg +timers model timers = + div + [ class "timers" ] + (List.map (Timer.view model) timers) -- cgit v1.2.3