Don't use JavaScript to stripe rows
[invirt/packages/invirt-web.git] / code / templates / list.mako
index c3167cb..d7d320a 100644 (file)
@@ -80,8 +80,12 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin
 % endif
 </%def>
 
 % endif
 </%def>
 
-<%def name="machineRow(machine)">
-      <tr> 
+<%def name="machineRow(machine, dark)">
+      <tr\
+% if dark:
+ class="stripedrow" \
+% endif
+> 
        <td rowspan="2">
        % if machine.uptime and installing[machine]:
        <img src="static/power_installing.png" alt="Installing..." />
        <td rowspan="2">
        % if machine.uptime and installing[machine]:
        <img src="static/power_installing.png" alt="Installing..." />
@@ -139,17 +143,10 @@ ${has_vnc[machine]}
        <th>Uptime</th>
        <th>VNC</th>
       </tr>
        <th>Uptime</th>
        <th>VNC</th>
       </tr>
-% for machine in machines:
-       ${machineRow(machine)}
+% for n, machine in enumerate(machines):
+       ${machineRow(machine, (n%2)==0)}
 % endfor
     </table>
 % endfor
     </table>
-    <script type="text/javascript" src="/static/stripe.js"></script>
-    <script type="text/javascript">
-        document.observe("dom:loaded", function() {
-            stripe($('machinelist').getElementsByTagName('table')[0],
-                   'stripedrow');
-        });
-    </script>
 </%def>
 
 <p style="font-size: 125%;"><a href="http://${config.web.hostname}">What is XVM?</a></p>
 </%def>
 
 <p style="font-size: 125%;"><a href="http://${config.web.hostname}">What is XVM?</a></p>