summaryrefslogtreecommitdiffabout
authorMichael Krelin <hacker@klever.net>2005-02-02 22:30:27 (UTC)
committer Michael Krelin <hacker@klever.net>2005-02-02 22:30:27 (UTC)
commit870963df2dac72e433fd7f94cd1cccc8cd6ea2d0 (patch) (unidiff)
treeedb6a3f9070ca67c9396ce548f28f82107afc119
parentb9ddf0a5135cf5b3371f38b41385fa8fc03da146 (diff)
downloadsitecing-870963df2dac72e433fd7f94cd1cccc8cd6ea2d0.zip
sitecing-870963df2dac72e433fd7f94cd1cccc8cd6ea2d0.tar.gz
sitecing-870963df2dac72e433fd7f94cd1cccc8cd6ea2d0.tar.bz2
1. changed version to -svn
2. added a really simple page example 3. removed 'border=' attribute from iframe 4. added notice about svn version 5. added 'site-C-ing:' prefix to the title
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,6 +1,7 @@
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) \
diff --git a/configure.ac b/configure.ac
index dc1beb3..744fe50 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,4 @@
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])
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,6 +1,11 @@
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>
@@ -21,8 +26,13 @@
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");
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
@@ -12,8 +12,8 @@
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>
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
@@ -34,6 +34,9 @@
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" },
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
@@ -41,7 +41,7 @@
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>
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
@@ -64,6 +64,13 @@ div#sidepanel h1 {
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;
@@ -130,14 +137,16 @@ div.source h1 {
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 {