From 6c313e88105bbaf6d0bb44d8a8ea4cf600acaa83 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Mon, 22 Apr 2013 13:42:24 -0400 Subject: Forum: Add title, body, and (incomplete) asker support --- forum/forum.ur | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/forum/forum.ur b/forum/forum.ur index 6579e56..df53603 100644 --- a/forum/forum.ur +++ b/forum/forum.ur @@ -23,30 +23,38 @@ end) = struct open Styles table question : { Id : int, - Body : string + Title : string, + Body : string, + Asker : option string (* 'None' if anonymous *) } PRIMARY KEY Id sequence questionIdS +fun prettyPrintQuestion row : xbody = + +

{[row.Question.Title]}: {[row.Question.Body]} (asked by {[row.Question.Asker]})

+
+ fun main () : transaction page = - newestQuestions <- queryX (SELECT * FROM question) (fn row => - -

{[row.Question.Body]}

-
); + newestQuestions <- queryX (SELECT * FROM question) prettyPrintQuestion; return ( Template.generic (Some "Forum")

All questions:

{newestQuestions}

Ask a new question:

-
+
+
+