From 2d698a74f90b0915dd8c2e3e42ce0f21d0a7bd1c Mon Sep 17 00:00:00 2001 From: Matthias Andreas Benkard Date: Wed, 2 Mar 2011 16:19:50 +0100 Subject: Add comment support to article template, add support for multiple page templates. --- schema.sql | 19 +++++++++++---- templates/article.html | 56 ++++++++++++++++++++++++++++++++++++++++++++ templates/journal_page.html | 15 ++++++++++++ templates/page_skeleton.html | 15 ++++++++++++ 4 files changed, 101 insertions(+), 4 deletions(-) create mode 100644 templates/journal_page.html create mode 100644 templates/page_skeleton.html diff --git a/schema.sql b/schema.sql index 914398c..909f6b3 100644 --- a/schema.sql +++ b/schema.sql @@ -40,11 +40,20 @@ CREATE TABLE login_certificates( FOREIGN KEY ("user") REFERENCES users ); -CREATE TABLE articles( - id SERIAL NOT NULL, +CREATE TABLE article_types( + id SERIAL NOT NULL, + name VARCHAR, + page_template VARCHAR, PRIMARY KEY (id) ); +CREATE TABLE articles( + id SERIAL NOT NULL, + type INTEGER NOT NULL, + PRIMARY KEY (id), + FOREIGN KEY (type) REFERENCES article_types +); + CREATE TABLE article_aliases( alias VARCHAR NOT NULL, article INTEGER NOT NULL, @@ -66,11 +75,13 @@ CREATE TABLE article_revisions( title VARCHAR NOT NULL, content VARCHAR NOT NULL, author INTEGER, - format varchar NOT NULL, + format VARCHAR NOT NULL, + status VARCHAR NOT NULL, PRIMARY KEY (id), FOREIGN KEY (article) REFERENCES articles, FOREIGN KEY (author) REFERENCES users, - CHECK (format IN ('html')) + CHECK (format IN ('html')), + CHECK (status IN ('draft', 'published', 'syndicated')) ); CREATE TABLE article_revision_characteristics( diff --git a/templates/article.html b/templates/article.html index 8eef256..24b5b17 100644 --- a/templates/article.html +++ b/templates/article.html @@ -33,3 +33,59 @@ + +{.section commentary} +
+

{comments-heading|html}

+ + {.repeated section comments} +
+ +
+ {body} +
+
+ {.end} + + {.section comment-submission} +

{title}

+ {notes} +
+
+ + +
+
+ {.repeated section fields} +
+
+ +
+
+ +
+
+ {.end} +
+
+ +
+
+ +
+
+
+
+
+ {.end} + +
+{.end} diff --git a/templates/journal_page.html b/templates/journal_page.html new file mode 100644 index 0000000..3106ca7 --- /dev/null +++ b/templates/journal_page.html @@ -0,0 +1,15 @@ +{.section head} + +{.end} + +{.section body} +

{site-name|html}

+
{site-subtitle|html}
+ +
+ {.repeated section articles} + {article|article-html} + {.end} +
+{.end} diff --git a/templates/page_skeleton.html b/templates/page_skeleton.html new file mode 100644 index 0000000..daa8781 --- /dev/null +++ b/templates/page_skeleton.html @@ -0,0 +1,15 @@ + + + + + + + {title|html} + {head} + + + + {body} + + + -- cgit v1.2.3