moved hamlet to widgetfiles

This commit is contained in:
Stuce 2025-07-02 17:37:55 +01:00
parent c63309b9e8
commit de60936cd2
11 changed files with 80 additions and 82 deletions

View file

@ -18,18 +18,7 @@ getGroupR = do
groups <- getGroups userId
defaultLayout $ do
setTitle "Groups"
[whamlet|
<a href=@{GroupR}>Home
<ul>
$forall group <- groups
<li>
<a href=@{TodolistR $ entityKey group}>#{(groupGroup . entityVal) group}
<form action=@{AddGroupR} method="post">
<input type="text" name="group" placeholder="new group">
<button type="submit">add
<a href=@{EditGroupR}>Edit
|]
$(widgetFile "group")
postAddGroupR :: Handler Html
postAddGroupR = do
g <- runInputPost $ ireq textField "group"
@ -48,16 +37,7 @@ getEditGroupR = do
defaultLayout $ do
let a e = pack $ show $ fromSqlKey $ entityKey e ::Text
setTitle "Groups"
[whamlet|
<form action=@{DeleteGroupR} method="POST">
<ul>
$forall group <- groups
<li>
<input type="checkbox" name="ids" value="#{a group}">
<a href="">#{(groupGroup . entityVal) group}
<button type=submit>Delete selected
<a href=@{GroupR}>Back
|]
$(widgetFile "edit-group")
postEditGroupR :: Handler Html
postEditGroupR = do
-- TODO: not implemented yet