From cda42d0259dad581350a802aaccb6a0c4f6bc5fd Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Sun, 9 Aug 2009 18:45:24 -0400 Subject: [PATCH] skeleton and helloworld Mako templates svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2666 --- code/templates/helloworld.mako | 7 +++ code/templates/{skeleton.tmpl => skeleton.mako} | 66 ++++++++++++----------- 2 files changed, 41 insertions(+), 32 deletions(-) create mode 100644 code/templates/helloworld.mako rename code/templates/{skeleton.tmpl => skeleton.mako} (61%) diff --git a/code/templates/helloworld.mako b/code/templates/helloworld.mako new file mode 100644 index 0000000..22111a1 --- /dev/null +++ b/code/templates/helloworld.mako @@ -0,0 +1,7 @@ +<%inherit file="skeleton.mako" /> + +Hello world! + +<%def name="title()"> +helloworld + diff --git a/code/templates/skeleton.tmpl b/code/templates/skeleton.mako similarity index 61% rename from code/templates/skeleton.tmpl rename to code/templates/skeleton.mako index e71348c..0fd67e3 100644 --- a/code/templates/skeleton.tmpl +++ b/code/templates/skeleton.mako @@ -1,12 +1,9 @@ -#from functions import functions -#extends functions - -#def full_body +<%page expression_filter="h"/> -$title — XVM +${self.title()} — XVM @@ -30,51 +27,56 @@ function helppopup(name){ -#if False +% if False:

We are in the process of modifying the service. Things likely will not work.

-#end if +% endif +% if error_text is not UNDEFINED:
-#if $varExists('error_text') -

STDERR:

$error_text
-#end if +

STDERR:

${error_text}
+% endif -#if not $varExists('simple') or not $simple -

Welcome, $user.

+% if not simple: +% if user: +

Welcome, ${user}.

+% endif -#end if + +% endif +
-#if $varExists('result') -$result -#end if +% if result: +${result} +% endif
-#if not $varExists('simple') or not $simple -

$title — XVM

-#end if -#filter None -$body -#end filter -#if not $varExists('simple') or not $simple +% if not simple: +

${self.title()} — XVM

+% endif +${next.body()} +% if not simple:
Questions? Contact xvm@mit.edu. -#end if +% endif -#end def + +<%def name="title()"> +XVM + -- 1.7.9.5