author | Michael Krelin <hacker@klever.net> | 2005-02-02 22:30:27 (UTC) |
---|---|---|
committer | Michael Krelin <hacker@klever.net> | 2005-02-02 22:30:27 (UTC) |
commit | 870963df2dac72e433fd7f94cd1cccc8cd6ea2d0 (patch) (side-by-side diff) | |
tree | edb6a3f9070ca67c9396ce548f28f82107afc119 | |
parent | b9ddf0a5135cf5b3371f38b41385fa8fc03da146 (diff) | |
download | sitecing-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
-rw-r--r-- | Makefile.am | 3 | ||||
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | htdocs/ancestry/layout.chtml | 12 | ||||
-rw-r--r-- | htdocs/ancestry/page.chtml | 4 | ||||
-rw-r--r-- | htdocs/ancestry/sources.chtml | 3 | ||||
-rw-r--r-- | htdocs/examples/calendar.chtml | 101 | ||||
-rw-r--r-- | htdocs/exceptions/compile.chtml | 2 | ||||
-rw-r--r-- | htdocs/simple.chtml | 31 | ||||
-rw-r--r-- | htdocs/style.css | 11 |
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,35 +1,36 @@ 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) \ $(addprefix htdocs/exceptions/production/,.htaccess .scrc compile.chtml compile.html preprocess.chtml runtime.chtml erroneous.h) \ $(addprefix htdocs/handlers/,.htaccess exception_dev exception_prod) \ autogen.sh \ NEWS NEWS.xml NEWS.xsl DISTCHECK_CONFIGURE_FLAGS=--enable-distcheck all-local: NEWS sitecode restart restart-apache distclean-local: rm -rf config.sitecing \ logs fastcgi-bin run cache NEWS: NEWS.xsl NEWS.xml ${XSLTPROC} -o $@ NEWS.xsl NEWS.xml sitecode: conf/sitecing.conf include/acconfig.h ${SHELL} bin/build restart: conf/sitecing.conf conf/dudki.conf if !DISTCHECKING if HAVE_DUDKI sudo ${SHELL} -c "@DUDKI@ -k @dudki_id@ ; sleep 3 ; @DUDKI@ -r" else kill `cat run/sitecing.pid` ; sleep 3 ; ${SHELL} bin/run endif endif !DISTCHECKING restart-apache: conf/httpd.conf if !DISTCHECKING @APACHE_RESTART_CMD@ endif !DISTCHECKING diff --git a/configure.ac b/configure.ac index dc1beb3..744fe50 100644 --- a/configure.ac +++ b/configure.ac @@ -1,33 +1,33 @@ -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]) AC_CONFIG_HEADER([include/acconfig.h]) AM_INIT_AUTOMAKE([dist-bzip2]) AC_PATH_PROG([XSLTPROC],[xsltproc],[true]) PKG_CHECK_MODULES([SITECING],[sitecing],,[ AC_MSG_ERROR([site-C-ing not found. get it at http://kin.klever.net/sitecing/]) ]) sitecing_prefix="$(${PKG_CONFIG} --variable=prefix sitecing)" sitecing_bindir="$(${PKG_CONFIG} --variable=bindir sitecing)" AC_MSG_CHECKING([for sitecing-fastcgi binary]) sitecing_fastcgi="${sitecing_bindir}/sitecing-fastcgi" if test -x "${sitecing_fastcgi}" ; then AC_MSG_RESULT([found ${sitecing_fastcgi}]) else AC_MSG_RESULT([not found]) AC_MSG_ERROR([broken site-C-ing install detected]) fi AC_MSG_CHECKING([for sitecing-build binary]) sitecing_build="${sitecing_bindir}/sitecing-build" if test -x "${sitecing_build}" ; then AC_MSG_RESULT([found ${sitecing_build}]) else AC_MSG_RESULT([not found]) AC_MSG_ERROR([broken site-C-ing install detected]) fi AC_SUBST([sitecing_prefix]) AC_SUBST([sitecing_bindir]) AC_SUBST([sitecing_fastcgi]) AC_SUBST([sitecing_build]) 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,35 +1,45 @@ % html(); return; /* vim:set ft=sitecing: */ %%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"> <%code> if(!access(WEB_RUN_ROOT "/conf/banner_top",R_OK)) { pass_file_through(WEB_RUN_ROOT "/conf/banner_top"); } content(); if(b_strict && !access(WEB_RUN_ROOT "/conf/banner_bottom",R_OK)) { pass_file_through(WEB_RUN_ROOT "/conf/banner_bottom"); } </%code> </div> <div id="sidepanel"> % sidepanel(); </div> </%method> <%method void content() %> </%method> <%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)) { pass_file_through(WEB_RUN_ROOT "/conf/banner_side"); } </%code> <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> <div class="copyright"> © <a href="http://www.klever.net/">Klever Group</a> </div> </%method> 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 @@ -1,28 +1,28 @@ % html(); return; /* vim:set ft=sitecing: */ %%var bool b_strict = true; <%decl> using std::string; </%decl> <%method void html() %> % if(b_strict){ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> % }else{ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> % } <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> <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> <body> % body(); </body> </html> </%method> <%codemethod string title() %> return "untitled"; </%codemethod> <%method void body() %> </%method> 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 @@ -5,64 +5,67 @@ const char *desc; } sourcefile_t; extern sourcefile_t source_files[]; extern int source_files_count; </%decl> <%impl> sourcefile_t source_files[] = { { "", 0, "the root" }, { "", "configure.ac", "main configuration file" }, { "", "acinclude.m4", "autoconf macros" }, { "", "autogen.sh", "shell script for building out of source repository" }, { "", "Makefile.am", "automake makefile template" }, { "", "NEWS.xml", "news since the last release (if any)" }, { "", "NEWS.xsl", "the styleshhet to make a plaintext version of NEWS.xml" }, { "", "COPYING", "copyright notice" }, { "", "AUTHORS", "Klever dissected" }, { 0, 0, 0 }, { "bin", 0, "various scripts" }, { "bin", "build.in", "the template of the script used to precompile the code" }, { "bin", "run.in", "the template of the script used to start fastcgi server" }, { 0, 0, 0 }, { "conf", 0, "configuration files" }, { "conf", "dudki.conf.in", "the template for the dudki daemon configuration file" }, { "conf", "httpd.conf.in", "the template for the apache configuration" }, { "conf", "sitecing.conf.in", "the template for the site-C-ing configuration" }, { 0, 0, 0 }, { "htdocs", 0, "the source files" }, { "htdocs", ".htaccess", "apache access-control file" }, { "htdocs", "index.chtml", "the introduction" }, { "htdocs", "sources.chtml", "the source browser" }, { "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" }, { "htdocs/exceptions", "preprocess.chtml", "preprocessor exceptions" }, { "htdocs/exceptions", "compile.chtml", "compile-time exceptions" }, { "htdocs/exceptions", "runtime.chtml", "runtime exceptions" }, { "htdocs/exceptions/development", 0, "development-mode exceptions samples" }, { "htdocs/exceptions/development", ".htaccess", "apache access control file" }, { "htdocs/exceptions/development", ".scrc", "site-C-ing local configuration" }, { "htdocs/exceptions/development", "preprocess.chtml", "the file that can not be preprocessed" }, { "htdocs/exceptions/development", "runtime.chtml", "exception thrown at runtime" }, { "htdocs/exceptions/development", "compile.chtml", "the file that can not be compiled" }, { "htdocs/exceptions/development", "erroneous.h", "the file to include for more errors" }, { "htdocs/exceptions/development", "compile.html", "compile-time exception handler output" }, { 0,0,0 }, { "htdocs/exceptions/production", 0, "production-mode exceptions samples" }, { "htdocs/exceptions/production", ".htaccess", "apache access control file" }, { "htdocs/exceptions/production", ".scrc", "site-C-ing local configuration" }, { "htdocs/exceptions/production", "preprocess.chtml", "the file that can not be preprocessed" }, { "htdocs/exceptions/production", "runtime.chtml", "exception thrown at runtime" }, { "htdocs/exceptions/production", "compile.chtml", "the file that can not be compiled" }, { "htdocs/exceptions/production", "erroneous.h", "the file to include for more errors" }, { "htdocs/exceptions/production", "compile.html", "compile-time exception handler output" }, { 0,0,0 }, { 0,0,0 }, { "htdocs/handlers", 0, "exception handlers" }, { "htdocs/handlers", ".htaccess", "apache access-control file" }, { "htdocs/handlers", "exception_dev", "development mode exception handler" }, { "htdocs/handlers", "exception_prod", "production mode exception handler" }, { 0,0,0 }, { "htdocs/ancestry", 0, "base components to build the rest upon" }, { "htdocs/ancestry", ".htaccess", "apache access control file" }, { "htdocs/ancestry", "page.chtml", "the xhtml skeleton" }, 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 @@ -12,39 +12,39 @@ Similar to <a href="/exceptions/preprocess">preprocessing exceptions</a> there is a wide range of errors you may put into your code which will pass through preprocessor and will be caught later at the compile-time. </p> <p> Once you complete writing your <a href="/view/htdocs/exceptions/development/compile.chtml" target="insert" title="the link opens in the frame below">erroneous code</a> and <em>site-C-ing</em> is done preprocessing it, it will feed the preprocessed code into c++ compiler which will refuse to compile the code like this. This is where <a href="/view/htdocs/handlers/exception_dev" target="insert" title="the link opens in the frame below">the exception handler</a>, specified in <a href="/view/htdocs/exceptions/development/.scrc" target="insert" title="the link opens in the frame below">the configuration file</a>, takes over the process and gives you <a href="/exceptions/development/compile" target="insert" title="the link opens in the frame below">the report</a>. Like with any handler, you may wish to set some <a href="/view/htdocs/handlers/exception_prod" target="insert" title="the link opens in the frame below">different handler</a> in your <a href="/view/htdocs/exceptions/production/.scrc" target="insert" title="the link opens in the frame below">production configuration</a>, which just gives user <a href="/exceptions/production/preprocess" target="insert" title="the link opens in the frame below">a friendly yet lame excuse</a>. </p> <p class="note"> Note, that these output pages are fakes -- I do not want to spawn the compiler each time you want to see the output and put this unnecessary load on cpu. These static pages are in fact saved output of the real exception handlers. </p> <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 <iframe> 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/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 <iframe> 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 @@ -35,64 +35,71 @@ div.google_ad { text-align: center; margin: 1ex; } div.google_ad.top { padding-bottom: 1ex; border-bottom: 1px gray solid; } div.google_ad.bottom { padding-top: 1ex; border-top: 1px gray solid; } div#sidepanel { position: absolute; top: 0px; left: 0px; margin: 0px; width: 20%; font-size: 80%; } div#content { position: absolute; top: 0px; right: -0px; margin: 0px; width: 80%; } div#sidepanel h1 { font-size: 80%; text-align: center; font-weight: normal; color: #004080; white-space: nowrap; 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; margin: 0.5ex; border-color: #c0c0c0 #404040 #404040 #c0c0c0; border-width: 1px 2px 2px 1px; border-style: solid; background: #d0d0d0; list-style-type: none; } div#sidepanel ul ul { margin: 0px; padding: 0px; border: none 0px; } div#sidepanel li { list-style-type: none; margin: 0px; padding: 0px; display: block; } div#sidepanel ul a { display: block; padding: 1px 1ex; margin: 0.5ex; border: 1px solid gray; text-decoration: none; background: white; color: black; } div#sidepanel ul a:hover { background: gray; color: white; } div#sidepanel ul ul a { @@ -101,68 +108,70 @@ div#sidepanel ul ul a { } div#sidepanel div.copyright { text-align: center; } div#content h1 { font-size: 140%; color: gray; font-weight: bold; text-align: center; margin: 1em; } div.insert { text-align: center; } iframe#insert { border: 1px solid black; } div.source h1 { background: #e0e0e0; border: 1px solid #808080; padding-left: 1em; margin: 0px; font-size: 100%; color: #000060; overflow: hidden; } 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; } ul.sourcebrowser { font-size: 70%; } ul.sourcebrowser ul.dir { padding: 1px 0px 2px 1em; margin: 1px 0px 1px 0px; } ul.sourcebrowser li.dir { margin: 1px 0px 1px 0px; } ul.sourcebrowser li.file { list-style-type: none; white-space: nowrap; display: inline; } ul.sourcebrowser li.file a { border: 1px solid gray; padding: 1px 0.5ex; text-decoration: none; font-family: monospace; } ul.sourcebrowser li.file a:hover { background: gray; border: 1px solid black; color: white; } |