module Web.View.Tasks.Index where import Web.View.Prelude data IndexView = IndexView { tasks :: [Include "tags" Task] } instance View IndexView where html IndexView { .. } = [hsx|

Tasks+ New

{forEach tasks renderTask}
Task
|] where breadcrumb = renderBreadcrumb [ breadcrumbLink "Tasks" TasksAction ] renderTask :: Include "tags" Task -> Html renderTask task = [hsx| {task.description} {renderTags task.tags} Show Edit Delete |] renderTags :: [Tag] -> Text renderTags tags = tags |> map (.name) |> intercalate ", "