Initial project setup

This commit is contained in:
Arne Weiss
2022-09-02 22:40:21 +02:00
commit ce35c0300c
41 changed files with 1127 additions and 0 deletions

26
Web/View/Entries/New.hs Normal file
View 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}
|]