Skip to content

Instantly share code, notes, and snippets.

@abuiles
Created March 8, 2009 17:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abuiles/75849 to your computer and use it in GitHub Desktop.
Save abuiles/75849 to your computer and use it in GitHub Desktop.
-- All the values which are called by getViewDataValue_u were specified in the action show in the controller Posts
markup = <div class="post">
<h1 class="title"><% getViewDataValue_u "post-title":: View String %></h1>
<p class="entry">
<% getViewDataValue_u "post-content":: View String %>
</p>
<p>
<small>
Created at: <% getViewDataValue_u "post-createdAt":: View String %>
</small>
</p>
<hr />
<br />
<h2> Comments </h2>
<hr />
<p class="comments">
<% do c <- getViewDataValue_u "comments-list" ::View [(String,String)]
mapM commentItem c
%>
</p>
<hr />
<h3>Add a comment</h3>
<form action=(getViewDataValue_u "save-comment-url" :: View String) method="post">
Author :
<input type="text" id="author" name="author"></input><br/><br />
<textarea name="body" id="body" cols="40" rows="5">
</textarea>
<br />
<input type="submit" value="Submit comment"/>
</form>
</div>
commentItem (a,b) = return $ cdata $ unlines $
["<div class='comments'>"
,"<p>By: "++ a ++ "</p>"
,"<p>" ++ b ++ "</p>"
,"</div>"
,"<hr>"
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment