+++ /dev/null
-/*
- * The general idea is from the following A List Apart article:
- * http://www.alistapart.com/articles/zebratables/
- *
- * The structure is inspired by the code fragment they supply, but the
- * code here is significantly cleaner. It also colors every two lines
- * rather than every line, since XVM uses two rows for each item.
- */
-
-function stripe(table, darkClass, lightClass) {
- for (var i = 0; i < table.rows.length; i++ ) {
- /* The header row should be light; the next two are dark. */
- if (i%4 == 1 || i%4 == 2)
- table.rows[i].className += ' ' + darkClass;
- else if (lightClass)
- table.rows[i].className += ' ' + lightClass;
- }
-}
% 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..." />
<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>
- <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>