Changeset 2666 for package_branches


Ignore:
Timestamp:
Dec 20, 2009, 9:44:03 PM (15 years ago)
Author:
broder
Message:

skeleton and helloworld Mako templates

Location:
package_branches/invirt-web/cherrypy-rebased/code/templates
Files:
1 added
1 moved

Legend:

Unmodified
Added
Removed
  • package_branches/invirt-web/cherrypy-rebased/code/templates/skeleton.mako

    r2665 r2666  
    1 #from functions import functions
    2 #extends functions
    3 
    4 #def full_body
     1<%page expression_filter="h"/>
    52<!DOCTYPE html
    63PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    74"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    85<html>
    9 <head><title>$title &mdash; XVM</title>
     6<head><title>${self.title()} &mdash; XVM</title>
    107  <link href="static/favicon.ico" type="image/x-icon" rel="shortcut icon">
    118  <link rel="stylesheet" href="static/style.css" type="text/css" />
     
    3128</head>
    3229<body id="body"
    33 #if hasattr($self, 'pageclass'):
    34   class="$pageclass"
    35 #end if
     30% if hasattr(self.attr, 'pageclass'):
     31  class="${self.attr.pageclass}"
     32% endif
    3633  >
    3734
    38 #if False
     35% if False:
    3936<div>
    4037<p>We are in the process of modifying the service.  Things likely will not work.</p>
    4138</div>
    42 #end if
     39% endif
    4340
     41% if error_text is not UNDEFINED:
    4442<div id="err">
    45 #if $varExists('error_text')
    46 <p>STDERR:</p><pre>$error_text</pre>
    47 #end if
     43<p>STDERR:</p><pre>${error_text}</pre>
    4844</div>
     45% endif
    4946
    50 #if not $varExists('simple') or not $simple
    51 <p class="loggedin">Welcome, <span class="name">$user</span>.</p>
     47% if not simple:
     48% if user:
     49<p class="loggedin">Welcome, <span class="name">${user}</span>.</p>
     50% endif
    5251
    5352<ul class="navigation">
    5453<li><a href="list">List</a></li>
    55 #if $varExists('machine')
    56 <li><a href="info?machine_id=$machine.machine_id">Info</a></li>
    57 <li><a href="vnc?machine_id=$machine.machine_id">Console</a></li>
    58 #end if
     54% if machine:
     55<li><a href="info?machine_id=${machine.machine_id}">Info</a></li>
     56<li><a href="vnc?machine_id=${machine.machine_id}">Console</a></li>
     57% endif
    5958<li><a href="help">Help</a></li>
    6059</ul>
    61 #end if
     60
     61% endif
     62
    6263<div id="result" class="result">
    63 #if $varExists('result')
    64 $result
    65 #end if
     64% if result:
     65${result}
     66% endif
    6667</div>
    6768
    68 #if not $varExists('simple') or not $simple
    69 <h1>$title &mdash; XVM</h1>
    70 #end if
    71 #filter None
    72 $body
    73 #end filter
    74 #if not $varExists('simple') or not $simple
     69% if not simple:
     70<h1>${self.title()} &mdash; XVM</h1>
     71% endif
     72${next.body()}
     73% if not simple:
    7574<hr />
    7675Questions? Contact <a href="mailto:xvm@mit.edu">xvm@mit.edu</a>.
    77 #end if
     76% endif
    7877</body>
    7978</html>
    80 #end def
     79
     80<%def name="title()">
     81XVM
     82</%def>
Note: See TracChangeset for help on using the changeset viewer.