From: Quentin Smith Date: Sun, 9 Aug 2009 22:45:24 +0000 (-0400) Subject: skeleton and helloworld Mako templates X-Git-Tag: 0.1.0^2~69 X-Git-Url: http://xvm.mit.edu/gitweb/invirt/packages/invirt-web.git/commitdiff_plain/cda42d0259dad581350a802aaccb6a0c4f6bc5fd?ds=sidebyside skeleton and helloworld Mako templates svn path=/package_branches/invirt-web/cherrypy-rebased/; revision=2666 --- 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 +