[Fencommits] fenserve: show times more nicely in board-demo.page
Benja Fallenstein
benja.fallenstein at gmail.com
Thu Mar 29 16:40:09 EEST 2007
Thu Mar 29 16:39:52 EEST 2007 Benja Fallenstein <benja.fallenstein at gmail.com>
* show times more nicely in board-demo.page
diff -rN -u old-fenserve/board-demo.page new-fenserve/board-demo.page
--- old-fenserve/board-demo.page 2007-03-29 16:40:08.000000000 +0300
+++ new-fenserve/board-demo.page 2007-03-29 16:40:08.000000000 +0300
@@ -1,4 +1,3 @@
-
dc = "http://purl.org/dc/elements/1.1/"
dcterms = "http://purl.org/dc/terms/"
sioc = "http://rdfs.org/sioc/ns#"
@@ -40,6 +39,11 @@
(post, sioc_has_container, blog) ]
blockquote html = <blockquote><% html %></blockquote>
+
+repl :: Eq a => [a] -> [a] -> [a] -> [a]
+repl pat r l | pat `List.isPrefixOf` l = r ++ repl pat r (drop (length pat) l)
+repl pat r (x:xs) = x : repl pat r xs
+repl _ _ [] = []
renderPost :: (?graph :: Graph) => Node -> HTML
renderPost p = let replyURI = "?view=post&inReplyTo=" ++ iriStr p
@@ -47,7 +51,8 @@
<div>
<h2><% postTitle p %> (<a href=editURI><i>Edit this</i></a> | <a
href=replyURI><i>Reply to this</i></a>)</h2>
- <p>Posted by <b><i><% postAuthor p %></i></b> on <% postDate p %></p>
+ <p>Posted by <b><i><% postAuthor p %></i></b> on
+ <% repl "Z" " UTC" $ repl "T" " " $ postDate p %></p>
<% HTML (postContent p) %>
<% map (blockquote . renderPost) (postReplies p) %>
</div>
More information about the Fencommits
mailing list