summaryrefslogtreecommitdiffabout
Unidiff
Diffstat (more/less context) (ignore 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,11 +1,12 @@
1EXTRA_DIST = \ 1EXTRA_DIST = \
2 $(addprefix htdocs/,.htaccess favicon.ico index.chtml sources.chtml style.css view.chtml) \ 2 $(addprefix htdocs/,.htaccess favicon.ico index.chtml simple.chtml sources.chtml style.css view.chtml) \
3 $(addprefix htdocs/ancestry/,.htaccess layout.chtml page.chtml sources.chtml) \ 3 $(addprefix htdocs/ancestry/,.htaccess layout.chtml page.chtml sources.chtml) \
4 $(addprefix htdocs/examples/,calendar.chtml) \
4 $(addprefix htdocs/exceptions/,index.chtml preprocess.chtml compile.chtml runtime.chtml) \ 5 $(addprefix htdocs/exceptions/,index.chtml preprocess.chtml compile.chtml runtime.chtml) \
5 $(addprefix htdocs/exceptions/development/,.htaccess .scrc compile.chtml compile.html preprocess.chtml runtime.chtml erroneous.h) \ 6 $(addprefix htdocs/exceptions/development/,.htaccess .scrc compile.chtml compile.html preprocess.chtml runtime.chtml erroneous.h) \
6 $(addprefix htdocs/exceptions/production/,.htaccess .scrc compile.chtml compile.html preprocess.chtml runtime.chtml erroneous.h) \ 7 $(addprefix htdocs/exceptions/production/,.htaccess .scrc compile.chtml compile.html preprocess.chtml runtime.chtml erroneous.h) \
7 $(addprefix htdocs/handlers/,.htaccess exception_dev exception_prod) \ 8 $(addprefix htdocs/handlers/,.htaccess exception_dev exception_prod) \
8 autogen.sh \ 9 autogen.sh \
9 NEWS NEWS.xml NEWS.xsl 10 NEWS NEWS.xml NEWS.xsl
10 11
11DISTCHECK_CONFIGURE_FLAGS=--enable-distcheck 12DISTCHECK_CONFIGURE_FLAGS=--enable-distcheck
diff --git a/configure.ac b/configure.ac
index dc1beb3..744fe50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,9 +1,9 @@
1AC_INIT([sitecing-showcase], [0.0], [sitecing-bugs@klever.net]) 1AC_INIT([sitecing-showcase], [0.0-svn], [sitecing-bugs@klever.net])
2AC_CONFIG_SRCDIR([htdocs/index.chtml]) 2AC_CONFIG_SRCDIR([htdocs/index.chtml])
3AC_CONFIG_AUX_DIR([aux]) 3AC_CONFIG_AUX_DIR([aux])
4AC_CONFIG_HEADER([include/acconfig.h]) 4AC_CONFIG_HEADER([include/acconfig.h])
5AM_INIT_AUTOMAKE([dist-bzip2]) 5AM_INIT_AUTOMAKE([dist-bzip2])
6 6
7AC_PATH_PROG([XSLTPROC],[xsltproc],[true]) 7AC_PATH_PROG([XSLTPROC],[xsltproc],[true])
8 8
9PKG_CHECK_MODULES([SITECING],[sitecing],,[ 9PKG_CHECK_MODULES([SITECING],[sitecing],,[
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
@@ -1,11 +1,16 @@
1% html(); return; /* vim:set ft=sitecing: */ 1% html(); return; /* vim:set ft=sitecing: */
2%%derive page = "/ancestry/page.chtml"; 2%%derive page = "/ancestry/page.chtml";
3%%impl #include "acconfig.h" 3%%impl #include "acconfig.h"
4%%var bool b_svn = false;
5<%constructor>
6 if(strstr(PACKAGE_STRING,"svn"))
7 b_svn = true;
8</%constructor>
4<%method void body() %> 9<%method void body() %>
5 <div id="content"> 10 <div id="content">
6 <%code> 11 <%code>
7 if(!access(WEB_RUN_ROOT "/conf/banner_top",R_OK)) { 12 if(!access(WEB_RUN_ROOT "/conf/banner_top",R_OK)) {
8 pass_file_through(WEB_RUN_ROOT "/conf/banner_top"); 13 pass_file_through(WEB_RUN_ROOT "/conf/banner_top");
9 } 14 }
10 content(); 15 content();
11 if(b_strict && !access(WEB_RUN_ROOT "/conf/banner_bottom",R_OK)) { 16 if(b_strict && !access(WEB_RUN_ROOT "/conf/banner_bottom",R_OK)) {
@@ -16,18 +21,23 @@
16 <div id="sidepanel"> 21 <div id="sidepanel">
17% sidepanel(); 22% sidepanel();
18 </div> 23 </div>
19</%method> 24</%method>
20<%method void content() %> 25<%method void content() %>
21</%method> 26</%method>
22<%method void sidepanel() %> 27<%method void sidepanel() %>
23 <h1><% PACKAGE_STRING %></h1> 28 <h1><% PACKAGE_STRING %></h1>
29% if(b_svn) {
30 <h2>The site is running source from the source repository which may differ
31 from the one available for download. You can check it out from the <a
32 href="http://kin.klever.net/sitecing/repository">source repository</a>.</h2>
33% }
24% /* thank MSIE for this awful formatting */ 34% /* thank MSIE for this awful formatting */
25 <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> 35 <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>
26 <%code> 36 <%code>
27 if(!access(WEB_RUN_ROOT "/conf/banner_side",R_OK)) { 37 if(!access(WEB_RUN_ROOT "/conf/banner_side",R_OK)) {
28 pass_file_through(WEB_RUN_ROOT "/conf/banner_side"); 38 pass_file_through(WEB_RUN_ROOT "/conf/banner_side");
29 } 39 }
30 </%code> 40 </%code>
31 <ul><li><a href="http://kin.klever.net/sitecing/" title="main site-C-ing page">site-C-ing</a></li><li><a href="http://kin.klever.net/sitecing/sources" title="site-C-ing download page">downloads</a></li></ul> 41 <ul><li><a href="http://kin.klever.net/sitecing/" title="main site-C-ing page">site-C-ing</a></li><li><a href="http://kin.klever.net/sitecing/sources" title="site-C-ing download page">downloads</a></li></ul>
32 <div class="copyright"> 42 <div class="copyright">
33 &copy; <a href="http://www.klever.net/">Klever Group</a> 43 &copy; <a href="http://www.klever.net/">Klever Group</a>
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
@@ -7,18 +7,18 @@
7% if(b_strict){ 7% if(b_strict){
8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 8 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
9% }else{ 9% }else{
10 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> 10 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
11% } 11% }
12 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> 12 <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
13 <head> 13 <head>
14% __SCIF->headers["Content-Type"] = "text/html"; 14% __SCIF->headers["Content-Type"] = "text/html";
15 <title><% title() %></title> 15 <title>site-C-ing: <% title() %></title>
16 <meta name="copyright" content="Copyright (c) 1996-2005 Klever Group"/> 16 <meta name="copyright" content="Copyright (c) 2005 Klever Group"/>
17 <link rel="stylesheet" href="/style.css" type="text/css" /> 17 <link rel="stylesheet" href="/style.css" type="text/css" />
18 </head> 18 </head>
19 <body> 19 <body>
20% body(); 20% body();
21 </body> 21 </body>
22 </html> 22 </html>
23</%method> 23</%method>
24<%codemethod string title() %> 24<%codemethod string title() %>
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
@@ -29,16 +29,19 @@
29 { "conf", "sitecing.conf.in", "the template for the site-C-ing configuration" }, 29 { "conf", "sitecing.conf.in", "the template for the site-C-ing configuration" },
30 { 0, 0, 0 }, 30 { 0, 0, 0 },
31 { "htdocs", 0, "the source files" }, 31 { "htdocs", 0, "the source files" },
32 { "htdocs", ".htaccess", "apache access-control file" }, 32 { "htdocs", ".htaccess", "apache access-control file" },
33 { "htdocs", "index.chtml", "the introduction" }, 33 { "htdocs", "index.chtml", "the introduction" },
34 { "htdocs", "sources.chtml", "the source browser" }, 34 { "htdocs", "sources.chtml", "the source browser" },
35 { "htdocs", "style.css", "the CSS style sheet" }, 35 { "htdocs", "style.css", "the CSS style sheet" },
36 { "htdocs", "view.chtml", "the source viewer" }, 36 { "htdocs", "view.chtml", "the source viewer" },
37 { "htdocs/examples", 0, "examples" },
38 { "htdocs/examples", "calendar.chtml", "really simple page" },
39 { 0,0,0 },
37 { "htdocs/exceptions", 0, "exceptions handling overview" }, 40 { "htdocs/exceptions", 0, "exceptions handling overview" },
38 { "htdocs/exceptions", "index.chtml", "the overview" }, 41 { "htdocs/exceptions", "index.chtml", "the overview" },
39 { "htdocs/exceptions", "preprocess.chtml", "preprocessor exceptions" }, 42 { "htdocs/exceptions", "preprocess.chtml", "preprocessor exceptions" },
40 { "htdocs/exceptions", "compile.chtml", "compile-time exceptions" }, 43 { "htdocs/exceptions", "compile.chtml", "compile-time exceptions" },
41 { "htdocs/exceptions", "runtime.chtml", "runtime exceptions" }, 44 { "htdocs/exceptions", "runtime.chtml", "runtime exceptions" },
42 { "htdocs/exceptions/development", 0, "development-mode exceptions samples" }, 45 { "htdocs/exceptions/development", 0, "development-mode exceptions samples" },
43 { "htdocs/exceptions/development", ".htaccess", "apache access control file" }, 46 { "htdocs/exceptions/development", ".htaccess", "apache access control file" },
44 { "htdocs/exceptions/development", ".scrc", "site-C-ing local configuration" }, 47 { "htdocs/exceptions/development", ".scrc", "site-C-ing local configuration" },
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 @@
1<%impl>
2 /* vim:set ft=sitecing: */
3 #include <time.h>
4 #include <konforka/exception.h>
5</%impl>
6<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
7<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
8 <head>
9 <title>really simple page</title>
10 <style type="text/css">
11 table.calendar {
12 font-family: monospace;
13 }
14 table.calendar th.heading {
15 border: double blue 3px;
16 }
17 table.calendar td {
18 text-align: right;
19 margin: 0.5ex; padding: 2px;
20 border: solid 1px black;
21 }
22 table.calendar .wd-0, table.calendar .wd-6 {
23 color: red;
24 }
25 table.calendar td.unexistant {
26 border: none;
27 }
28 table.calendar td.today {
29 background: #ffffc0;
30 color: blue;
31 font-weight: bold;
32 }
33 </style>
34 </head>
35 <body>
36% /* Just call the calendar member function */
37% calendar();
38 </body>
39</html>
40<%method void calendar() %>
41 <%code>
42 time_t tt = time(0);
43 struct tm t;
44 if(!localtime_r(&tt,&t))
45 throw konforka::exception(CODEPOINT,"couldn't fetch current date");
46 char h[16];
47 if(strftime(h,sizeof(h),"%B, %Y",&t)>=sizeof(h))
48 throw konforka::exception(CODEPOINT,"couldn't produce heading for the calendar");
49 int today = t.tm_mday;
50 t.tm_mday = 1;
51 tt=mktime(&t);
52 if(!localtime_r(&tt,&t))
53 throw konforka::exception(CODEPOINT,"couldn't fetch current date");
54 int dim = 31;
55 if(t.tm_mon==3 || t.tm_mon==5 || t.tm_mon==8 || t.tm_mon==10) {
56 dim = 30;
57 }else if(t.tm_mon==1) {
58 dim = (t.tm_year%4)?28:29;
59 }
60 </%code>
61 <table class="calendar">
62 <tr>
63 <th class="heading" colspan="7"><% h %></th>
64 </tr>
65 <tr>
66 <th class="wd-0">Sun</th>
67 <th class="wd-1">Mon</th>
68 <th class="wd-2">Tue</th>
69 <th class="wd-3">Wed</th>
70 <th class="wd-4">Thu</th>
71 <th class="wd-5">Fri</th>
72 <th class="wd-6">Sat</th>
73 </tr>
74 <%code>
75 int dow=0; int dom=1-t.tm_wday;
76 for(;;dom++,dow=(dow+1)%7) {
77 if(!dow) {
78 <%output>
79 <tr>
80 </%output>
81 }
82 bool be = (dom>=1 && dom<=dim);
83 std::string ec = be?" existant":" unexistant";
84 if(dom==today)
85 ec+=" today";
86 <%output><td class="wd-<% dow %><% ec %>"></%output>
87 if(be) {
88 <%output><% dom %></%output>
89 }
90 <%output></td></%output>
91 if(dow==6) {
92 <%output>
93 </tr>
94 </%output>
95 if(dom>=dim)
96 break;
97 }
98 }
99 </%code>
100 </table>
101</%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
@@ -36,15 +36,15 @@
36 <p class="note"> 36 <p class="note">
37 Note, that these output pages are fakes -- I do not want to spawn the 37 Note, that these output pages are fakes -- I do not want to spawn the
38 compiler each time you want to see the output and put this unnecessary load 38 compiler each time you want to see the output and put this unnecessary load
39 on cpu. These static pages are in fact saved output of the real exception 39 on cpu. These static pages are in fact saved output of the real exception
40 handlers. 40 handlers.
41 </p> 41 </p>
42 42
43 <div class="insert"> 43 <div class="insert">
44 <iframe id="insert" name="insert" src="about:blank" width="95%" height="300" border="1"> 44 <iframe id="insert" name="insert" src="about:blank" width="95%" height="300">
45 <p>I wanted to put an &lt;iframe&gt; here, but your browser does not seem to 45 <p>I wanted to put an &lt;iframe&gt; here, but your browser does not seem to
46 support it. That is okay, it still will open links somehow.</p> 46 support it. That is okay, it still will open links somehow.</p>
47 </iframe> 47 </iframe>
48 </div> 48 </div>
49 49
50</%method> 50</%method>
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 @@
1% html(); return; /* vim:set ft=sitecing: */
2%%derive layout = "/ancestry/layout.chtml";
3<%constructor>
4 b_strict = false;
5</%constructor>
6<%codemethod string title() %>
7 return "simple page";
8</%codemethod>
9<%method void content() %>
10 <h1>building a really simple page</h1>
11 <p>
12 Building a really simple page is really simple. I will not go into much detail
13 here. The example provided should speak for itself.
14 </p>
15 <p>
16 The component being written doesn't do much but show you the calendar for the
17 current month. First, take a look at <a
18 href="/view/htdocs/examples/calendar.chtml" title="the link opens in the frame
19 below" target="insert">the code</a> and, after you examined it, feel free to check out
20 <a href="/examples/calendar" title="the link opens in the frame below"
21 target="insert">the output</a>.
22 </p>
23
24 <div class="insert">
25 <iframe id="insert" name="insert" src="about:blank" width="95%" height="300">
26 <p>I wanted to put an &lt;iframe&gt; here, but your browser does not seem to
27 support it. That is okay, it still will open links somehow.</p>
28 </iframe>
29 </div>
30
31</%method>
diff --git a/htdocs/style.css b/htdocs/style.css
index 01fd43a..3ab1b6f 100644
--- a/htdocs/style.css
+++ b/htdocs/style.css
@@ -59,16 +59,23 @@ div#content {
59div#sidepanel h1 { 59div#sidepanel h1 {
60 font-size: 80%; 60 font-size: 80%;
61 text-align: center; 61 text-align: center;
62 font-weight: normal; 62 font-weight: normal;
63 color: #004080; 63 color: #004080;
64 white-space: nowrap; 64 white-space: nowrap;
65 margin-top: 2ex; margin-bottom: 2ex; 65 margin-top: 2ex; margin-bottom: 2ex;
66} 66}
67div#sidepanel h2 {
68 font-size: 80%;
69 text-align: justify;
70 font-weight: normal;
71 color: gray;
72 margin: 1ex 1ex;
73}
67div#sidepanel ul { 74div#sidepanel ul {
68 padding: 1ex 0.5ex 1ex 1ex; 75 padding: 1ex 0.5ex 1ex 1ex;
69 margin: 0.5ex; 76 margin: 0.5ex;
70 border-color: #c0c0c0 #404040 #404040 #c0c0c0; 77 border-color: #c0c0c0 #404040 #404040 #c0c0c0;
71 border-width: 1px 2px 2px 1px; 78 border-width: 1px 2px 2px 1px;
72 border-style: solid; 79 border-style: solid;
73 background: #d0d0d0; 80 background: #d0d0d0;
74 list-style-type: none; 81 list-style-type: none;
@@ -125,24 +132,26 @@ div.source h1 {
125 margin: 0px; 132 margin: 0px;
126 font-size: 100%; 133 font-size: 100%;
127 color: #000060; 134 color: #000060;
128 overflow: hidden; 135 overflow: hidden;
129} 136}
130div.source ul { 137div.source ul {
131 background: #80c0c0; 138 background: #80c0c0;
132 margin: 0px; 139 margin: 0px;
133 padding: 1px 0.5ex; 140 padding: 1px 0px;
134 font-family: monospace; 141 font-family: monospace;
135 font-size: 80%; 142 font-size: 80%;
136 overflow: hidden; 143 overflow: hidden;
144 width:100%;
137} 145}
138div.source li { 146div.source li {
139 list-style-type: none; 147 list-style-type: none;
140 white-space: nowrap; 148 white-space: nowrap;
149 margin: 0px 0.5ex;
141} 150}
142 151
143ul.sourcebrowser { 152ul.sourcebrowser {
144 font-size: 70%; 153 font-size: 70%;
145} 154}
146ul.sourcebrowser ul.dir { 155ul.sourcebrowser ul.dir {
147 padding: 1px 0px 2px 1em; 156 padding: 1px 0px 2px 1em;
148 margin: 1px 0px 1px 0px; 157 margin: 1px 0px 1px 0px;