module Web.View.Items.Index where import Web.View.Prelude data IndexView = IndexView { items :: [Include "tags" Item] } instance View IndexView where html IndexView { .. } = [hsx|

Items+ New

{forEach items renderItem}
Item
|] where breadcrumb = renderBreadcrumb [ breadcrumbLink "Items" ItemsAction ] renderItem :: Include "tags" Item -> Html renderItem item = [hsx| {item.description} {renderTags item.tags} Show Edit Delete |] renderTags :: [Tag] -> Text renderTags tags = tags |> map (.name) |> intercalate ", "