From 3f4e4e506afe8f30e5114327863eddb2cc512fc3 Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Tue, 30 Apr 2013 14:02:35 -0400 Subject: Forum: Rename "question" to "entry" --- forum/forum.css | 15 +++++++++------ forum/forum.ur | 46 +++++++++++++++++++++++----------------------- 2 files changed, 32 insertions(+), 29 deletions(-) diff --git a/forum/forum.css b/forum/forum.css index 56b0763..4f7b7f2 100644 --- a/forum/forum.css +++ b/forum/forum.css @@ -16,28 +16,31 @@ * You should have received a copy of the GNU Affero General Public License * along with 6.947. If not, see . */ -.Forum_questionList { +.Forum_entryList { list-style-type: none; margin-top: 0; padding-left: 0; } -.Forum_questionList li { +.Forum_entryList li { margin-bottom: 1em; } -.Forum_questionMetadata { - padding-left: 2em; +.Forum_entryMetadata { font-style: italic; color: hsl(0, 0%, 65%); } -.Forum_questionEntryTitle, .Forum_questionEntryBody { +li .Forum_entryMetadata { + padding-left: 2em; +} + +.Forum_entryTitle, .Forum_entryBody { font-family: sans-serif; font-size: 0.8em; width: 40em; } -.Forum_questionEntryBody { +.Forum_entryBody { height: 15em; } diff --git a/forum/forum.ur b/forum/forum.ur index e8a4be5..3c376ec 100644 --- a/forum/forum.ur +++ b/forum/forum.ur @@ -23,17 +23,17 @@ end) = struct open Styles open Author -style questionList -style questionMetadata -style questionEntryTitle -style questionEntryBody +style entryList +style entryMetadata +style entryTitle +style entryBody -table question : { Id : int, - Title : string, - Body : string, - Author : author - } PRIMARY KEY Id -sequence questionIdS +table entry : { Id : int, + Title : string, + Body : string, + Author : author + } PRIMARY KEY Id +sequence entryIdS (* Grabs real name out of MIT certificate. *) val getName : transaction (option string) = @@ -42,21 +42,21 @@ val getName : transaction (option string) = fun prettyPrintQuestion row : xbody =
  • -

    {[row.Question.Title]}

    - {[row.Question.Body]} - Asked by {[row.Question.Author]} +

    {[row.Entry.Title]}

    + {[row.Entry.Body]} + Asked by {[row.Entry.Author]}
  • val allQuestions : transaction page = - questionsList <- queryX (SELECT * FROM question - ORDER BY Question.Id DESC) + questionsList <- queryX (SELECT * FROM entry + ORDER BY Entry.Id DESC) prettyPrintQuestion; return ( Template.generic (Some "Forum – All questions")

    All questions

    -
      +
        {questionsList}
    @@ -64,8 +64,8 @@ val allQuestions : transaction page = ) fun main () : transaction page = - newestQuestions <- queryX (SELECT * FROM question - ORDER BY Question.Id DESC + newestQuestions <- queryX (SELECT * FROM entry + ORDER BY Entry.Id DESC LIMIT 5) prettyPrintQuestion; askerOpt <- getName; @@ -73,15 +73,15 @@ fun main () : transaction page = Template.generic (Some "Forum")

    Latest questions

    -
      +
        {newestQuestions}
      View all questions

      Ask a new question

      -
      -