Created
March 8, 2009 17:59
-
-
Save abuiles/75849 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 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