7964aca21a29c9e59b01d995397f1861c748142b
[invirt/packages/invirt-web.git] / templates / skeleton.tmpl
1 #from functions import functions
2 #extends functions
3
4 #def full_body
5 <!DOCTYPE html
6 PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
7 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
8 <html>
9 <head><title>$title</title>
10   <link href="static/favicon.ico" type="image/x-icon" rel="shortcut icon">
11   <link rel="stylesheet" href="static/style.css" type="text/css" />
12   <link rel="stylesheet" href="static/layout.css" type="text/css" media="screen" />
13   <script type="text/javascript" src="static/prototype.js"></script>
14   <script type="text/javascript">
15 var helpWin = null;
16 function closeWin(){
17         if (helpWin != null){
18                 if(!helpWin.closed)
19                         helpWin.close();
20         }
21 }
22
23 function helppopup(name){
24    closeWin()
25    helpWin = window.open("help?simple=true&subject="+encodeURIComponent(name), "Help",
26 "status, height = 300, width = 400");
27    if (window.focus){helpWin.focus();}
28    return false;
29 }
30
31 Ajax.Responders.register({
32   onCreate: function(){
33     if (Ajax.activeRequestCount > 0) {
34        document.getElementById("loadingnotice").style.display = 'block';
35     }
36   }, 
37   onComplete: function(){
38     if (Ajax.activeRequestCount == 0) {
39       document.getElementById("loadingnotice").style.display = 'none';
40     } 
41   }
42 });
43 function replaceFunc(transport) {
44   try {
45     d = transport.responseText.evalJSON();
46   } catch (e) {
47     \$('body').innerHTML = '<pre>'+transport.responseText+'</pre>'
48     return;
49   }
50   for(key in d) {
51     \$(key).innerHTML = d[key];
52   }
53 }
54
55 function jsFormSubmit(location, elt){
56   new Ajax.Request(location, {method: 'post', 
57   parameters: Form.serialize(elt)+'&js=true', 
58   onSuccess: replaceFunc,
59   onComplete: function() {Form.enable(elt);}
60   });
61   Form.disable(elt);
62   return false;
63 }
64
65 function rowFormSubmit(elt, retpage){
66   new Ajax.Request('command', {method: 'post', 
67   parameters: Form.serialize(elt)+'&js='+retpage, 
68   onSuccess: replaceFunc
69   });
70   return false;
71 }
72
73 window.onload = {
74   //Fix bug with disabled elements
75   $$('form').each(Form.enable);
76 }
77
78 </script>
79 </head>
80 <body id="body">
81
82 <div id="err">
83 #if $varExists('error_text')
84 <p>STDERR:</p><pre>$error_text</pre>
85 #end if
86 </div>
87
88 #if not $varExists('simple') or not $simple
89 <p>[You are logged in as $user.username.]</p>
90
91 <div class="navigation">
92 <p><a href="list">List</a> 
93 #if $varExists('machine')
94 <a href="info?machine_id=$machine.machine_id">Info</a>
95 <a href="vnc?machine_id=$machine.machine_id">Console</a>
96 #end if
97 <a href="help">Help</a></p>
98 #end if
99 </div>
100
101 <div id="loadingnotice" class="loadingnotice">LOADING</div>
102 <div id="result" class="result"></div>
103
104 $body
105 #if not $varExists('simple') or not $simple
106 <hr />
107 Questions? Contact <a href="mailto:sipb-xen-dev@mit.edu">sipb-xen-dev@mit.edu</a>.
108 #end if
109 </body>
110 </html>
111 #end def