summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--Makefile.am3
-rw-r--r--configure.ac2
-rw-r--r--htdocs/ancestry/layout.chtml12
-rw-r--r--htdocs/ancestry/page.chtml4
-rw-r--r--htdocs/ancestry/sources.chtml3
-rw-r--r--htdocs/examples/calendar.chtml101
-rw-r--r--htdocs/exceptions/compile.chtml2
-rw-r--r--htdocs/simple.chtml31
-rw-r--r--htdocs/style.css11
9 files changed, 162 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am
index 529f5ae..105b377 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,5 +1,6 @@
EXTRA_DIST = \
- $(addprefix htdocs/,.htaccess favicon.ico index.chtml sources.chtml style.css view.chtml) \
+ $(addprefix htdocs/,.htaccess favicon.ico index.chtml simple.chtml sources.chtml style.css view.chtml) \
$(addprefix htdocs/ancestry/,.htaccess layout.chtml page.chtml sources.chtml) \
+ $(addprefix htdocs/examples/,calendar.chtml) \
$(addprefix htdocs/exceptions/,index.chtml preprocess.chtml compile.chtml runtime.chtml) \
$(addprefix htdocs/exceptions/development/,.htaccess .scrc compile.chtml compile.html preprocess.chtml runtime.chtml erroneous.h) \
diff --git a/configure.ac b/configure.ac
index dc1beb3..744fe50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,3 +1,3 @@
-AC_INIT([sitecing-showcase], [0.0], [sitecing-bugs@klever.net])
+AC_INIT([sitecing-showcase], [0.0-svn], [sitecing-bugs@klever.net])
AC_CONFIG_SRCDIR([htdocs/index.chtml])
AC_CONFIG_AUX_DIR([aux])
diff --git a/htdocs/ancestry/layout.chtml b/htdocs/ancestry/layout.chtml
index 11bd74a..6147d37 100644
--- a/htdocs/ancestry/layout.chtml
+++ b/htdocs/ancestry/layout.chtml
@@ -2,4 +2,9 @@
%%derive page = "/ancestry/page.chtml";
%%impl #include "acconfig.h"
+%%var bool b_svn = false;
+<%constructor>
+ if(strstr(PACKAGE_STRING,"svn"))
+ b_svn = true;
+</%constructor>
<%method void body() %>
<div id="content">
@@ -22,6 +27,11 @@
<%method void sidepanel() %>
<h1><% PACKAGE_STRING %></h1>
+% if(b_svn) {
+ <h2>The site is running source from the source repository which may differ
+ from the one available for download. You can check it out from the <a
+ href="http://kin.klever.net/sitecing/repository">source repository</a>.</h2>
+% }
% /* thank MSIE for this awful formatting */
- <ul><li><a href="/" title="introduction to site-C-ing">intro</a></li><li><a href="/exceptions/" title="exceptions handling">exceptions</a><ul><li><a href="/exceptions/preprocess" title="preprocessor errors">preprocess</a></li><li><a href="/exceptions/compile" title="compiler errors">compile-time</a></li><li><a href="/exceptions/runtime" title="runtime exceptions">runtime</a></li></ul></li><li><a href="/sources" title="browse this site source files">sources</a></li></ul>
+ <ul><li><a href="/" title="introduction to site-C-ing">overview</a><ul><li><a href="/simple" title="building a really simple page">simple page</a></li></ul></li><li><a href="/exceptions/" title="exceptions handling">exceptions</a><ul><li><a href="/exceptions/preprocess" title="preprocessor errors">preprocess</a></li><li><a href="/exceptions/compile" title="compiler errors">compile-time</a></li><li><a href="/exceptions/runtime" title="runtime exceptions">runtime</a></li></ul></li><li><a href="/sources" title="browse this site source files">sources</a></li></ul>
<%code>
if(!access(WEB_RUN_ROOT "/conf/banner_side",R_OK)) {
diff --git a/htdocs/ancestry/page.chtml b/htdocs/ancestry/page.chtml
index 28bf7f0..5bec31e 100644
--- a/htdocs/ancestry/page.chtml
+++ b/htdocs/ancestry/page.chtml
@@ -13,6 +13,6 @@
<head>
% __SCIF->headers["Content-Type"] = "text/html";
- <title><% title() %></title>
- <meta name="copyright" content="Copyright (c) 1996-2005 Klever Group"/>
+ <title>site-C-ing: <% title() %></title>
+ <meta name="copyright" content="Copyright (c) 2005 Klever Group"/>
<link rel="stylesheet" href="/style.css" type="text/css" />
</head>
diff --git a/htdocs/ancestry/sources.chtml b/htdocs/ancestry/sources.chtml
index eb9c790..35ced64 100644
--- a/htdocs/ancestry/sources.chtml
+++ b/htdocs/ancestry/sources.chtml
@@ -35,4 +35,7 @@
{ "htdocs", "style.css", "the CSS style sheet" },
{ "htdocs", "view.chtml", "the source viewer" },
+ { "htdocs/examples", 0, "examples" },
+ { "htdocs/examples", "calendar.chtml", "really simple page" },
+ { 0,0,0 },
{ "htdocs/exceptions", 0, "exceptions handling overview" },
{ "htdocs/exceptions", "index.chtml", "the overview" },
diff --git a/htdocs/examples/calendar.chtml b/htdocs/examples/calendar.chtml
new file mode 100644
index 0000000..eea20cb
--- a/dev/null
+++ b/htdocs/examples/calendar.chtml
@@ -0,0 +1,101 @@
+<%impl>
+ /* vim:set ft=sitecing: */
+ #include <time.h>
+ #include <konforka/exception.h>
+</%impl>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+ <head>
+ <title>really simple page</title>
+ <style type="text/css">
+ table.calendar {
+ font-family: monospace;
+ }
+ table.calendar th.heading {
+ border: double blue 3px;
+ }
+ table.calendar td {
+ text-align: right;
+ margin: 0.5ex; padding: 2px;
+ border: solid 1px black;
+ }
+ table.calendar .wd-0, table.calendar .wd-6 {
+ color: red;
+ }
+ table.calendar td.unexistant {
+ border: none;
+ }
+ table.calendar td.today {
+ background: #ffffc0;
+ color: blue;
+ font-weight: bold;
+ }
+ </style>
+ </head>
+ <body>
+% /* Just call the calendar member function */
+% calendar();
+ </body>
+</html>
+<%method void calendar() %>
+ <%code>
+ time_t tt = time(0);
+ struct tm t;
+ if(!localtime_r(&tt,&t))
+ throw konforka::exception(CODEPOINT,"couldn't fetch current date");
+ char h[16];
+ if(strftime(h,sizeof(h),"%B, %Y",&t)>=sizeof(h))
+ throw konforka::exception(CODEPOINT,"couldn't produce heading for the calendar");
+ int today = t.tm_mday;
+ t.tm_mday = 1;
+ tt=mktime(&t);
+ if(!localtime_r(&tt,&t))
+ throw konforka::exception(CODEPOINT,"couldn't fetch current date");
+ int dim = 31;
+ if(t.tm_mon==3 || t.tm_mon==5 || t.tm_mon==8 || t.tm_mon==10) {
+ dim = 30;
+ }else if(t.tm_mon==1) {
+ dim = (t.tm_year%4)?28:29;
+ }
+ </%code>
+ <table class="calendar">
+ <tr>
+ <th class="heading" colspan="7"><% h %></th>
+ </tr>
+ <tr>
+ <th class="wd-0">Sun</th>
+ <th class="wd-1">Mon</th>
+ <th class="wd-2">Tue</th>
+ <th class="wd-3">Wed</th>
+ <th class="wd-4">Thu</th>
+ <th class="wd-5">Fri</th>
+ <th class="wd-6">Sat</th>
+ </tr>
+ <%code>
+ int dow=0; int dom=1-t.tm_wday;
+ for(;;dom++,dow=(dow+1)%7) {
+ if(!dow) {
+ <%output>
+ <tr>
+ </%output>
+ }
+ bool be = (dom>=1 && dom<=dim);
+ std::string ec = be?" existant":" unexistant";
+ if(dom==today)
+ ec+=" today";
+ <%output><td class="wd-<% dow %><% ec %>"></%output>
+ if(be) {
+ <%output><% dom %></%output>
+ }
+ <%output></td></%output>
+ if(dow==6) {
+ <%output>
+ </tr>
+ </%output>
+ if(dom>=dim)
+ break;
+ }
+ }
+ </%code>
+ </table>
+</%method>
diff --git a/htdocs/exceptions/compile.chtml b/htdocs/exceptions/compile.chtml
index 90ee7d8..aa4c8df 100644
--- a/htdocs/exceptions/compile.chtml
+++ b/htdocs/exceptions/compile.chtml
@@ -42,5 +42,5 @@
<div class="insert">
- <iframe id="insert" name="insert" src="about:blank" width="95%" height="300" border="1">
+ <iframe id="insert" name="insert" src="about:blank" width="95%" height="300">
<p>I wanted to put an &lt;iframe&gt; here, but your browser does not seem to
support it. That is okay, it still will open links somehow.</p>
diff --git a/htdocs/simple.chtml b/htdocs/simple.chtml
new file mode 100644
index 0000000..9900f00
--- a/dev/null
+++ b/htdocs/simple.chtml
@@ -0,0 +1,31 @@
+% html(); return; /* vim:set ft=sitecing: */
+%%derive layout = "/ancestry/layout.chtml";
+<%constructor>
+ b_strict = false;
+</%constructor>
+<%codemethod string title() %>
+ return "simple page";
+</%codemethod>
+<%method void content() %>
+ <h1>building a really simple page</h1>
+ <p>
+ Building a really simple page is really simple. I will not go into much detail
+ here. The example provided should speak for itself.
+ </p>
+ <p>
+ The component being written doesn't do much but show you the calendar for the
+ current month. First, take a look at <a
+ href="/view/htdocs/examples/calendar.chtml" title="the link opens in the frame
+ below" target="insert">the code</a> and, after you examined it, feel free to check out
+ <a href="/examples/calendar" title="the link opens in the frame below"
+ target="insert">the output</a>.
+ </p>
+
+ <div class="insert">
+ <iframe id="insert" name="insert" src="about:blank" width="95%" height="300">
+ <p>I wanted to put an &lt;iframe&gt; here, but your browser does not seem to
+ support it. That is okay, it still will open links somehow.</p>
+ </iframe>
+ </div>
+
+</%method>
diff --git a/htdocs/style.css b/htdocs/style.css
index 01fd43a..3ab1b6f 100644
--- a/htdocs/style.css
+++ b/htdocs/style.css
@@ -65,4 +65,11 @@ div#sidepanel h1 {
margin-top: 2ex; margin-bottom: 2ex;
}
+div#sidepanel h2 {
+ font-size: 80%;
+ text-align: justify;
+ font-weight: normal;
+ color: gray;
+ margin: 1ex 1ex;
+}
div#sidepanel ul {
padding: 1ex 0.5ex 1ex 1ex;
@@ -131,12 +138,14 @@ div.source ul {
background: #80c0c0;
margin: 0px;
- padding: 1px 0.5ex;
+ padding: 1px 0px;
font-family: monospace;
font-size: 80%;
overflow: hidden;
+ width:100%;
}
div.source li {
list-style-type: none;
white-space: nowrap;
+ margin: 0px 0.5ex;
}