Initial project setup
This commit is contained in:
26
Web/View/Entries/New.hs
Normal file
26
Web/View/Entries/New.hs
Normal file
@@ -0,0 +1,26 @@
|
||||
module Web.View.Entries.New where
|
||||
import Web.View.Prelude
|
||||
|
||||
data NewView = NewView { entry :: Entry }
|
||||
|
||||
instance View NewView where
|
||||
html NewView { .. } = [hsx|
|
||||
{breadcrumb}
|
||||
<h1>New Entry</h1>
|
||||
{renderForm entry}
|
||||
|]
|
||||
where
|
||||
breadcrumb = renderBreadcrumb
|
||||
[ breadcrumbLink "Entries" EntriesAction
|
||||
, breadcrumbText "New Entry"
|
||||
]
|
||||
|
||||
renderForm :: Entry -> Html
|
||||
renderForm entry = formFor entry [hsx|
|
||||
{(textField #till)}
|
||||
{(textField #day)}
|
||||
{(textField #comment)}
|
||||
{(textField #isfree)}
|
||||
{submitButton}
|
||||
|
||||
|]
|
||||
Reference in New Issue
Block a user