From 6658211de695c3b138f33ad9d8d39bad1581a316 Mon Sep 17 00:00:00 2001 From: Quentin Smith Date: Sun, 27 Dec 2009 20:13:29 -0500 Subject: [PATCH] Don't use JavaScript to stripe rows svn path=/trunk/packages/invirt-web/; revision=2796 --- code/static/stripe.js | 18 ------------------ code/templates/list.mako | 19 ++++++++----------- 2 files changed, 8 insertions(+), 29 deletions(-) delete mode 100644 code/static/stripe.js diff --git a/code/static/stripe.js b/code/static/stripe.js deleted file mode 100644 index f1c16de..0000000 --- a/code/static/stripe.js +++ /dev/null @@ -1,18 +0,0 @@ -/* - * 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; - } -} diff --git a/code/templates/list.mako b/code/templates/list.mako index c3167cb..d7d320a 100644 --- a/code/templates/list.mako +++ b/code/templates/list.mako @@ -80,8 +80,12 @@ ${self.fn.cdromList(defaults.cdrom, "$('cd_or_auto_cd').checked = true;$('autoin % endif -<%def name="machineRow(machine)"> - +<%def name="machineRow(machine, dark)"> + % if machine.uptime and installing[machine]: Installing... @@ -139,17 +143,10 @@ ${has_vnc[machine]} Uptime VNC -% for machine in machines: - ${machineRow(machine)} +% for n, machine in enumerate(machines): + ${machineRow(machine, (n%2)==0)} % endfor - -

What is XVM?

-- 1.7.9.5