]> ruin.nu Git - ndwebbie.git/commitdiff
nicer table in check
authorMichael Andreen <harv@ruin.nu>
Thu, 28 Dec 2006 20:33:43 +0000 (20:33 +0000)
committerMichael Andreen <harv@ruin.nu>
Thu, 28 Dec 2006 20:33:43 +0000 (20:33 +0000)
check.pl
templates/check.tmpl

index 9112aa21982b1bc9000c4c01aa6aeca9f9dd708c..788e93887fd25dee5b3ad2e12bca38a1004f9604 100644 (file)
--- a/check.pl
+++ b/check.pl
@@ -74,6 +74,7 @@ if (defined $z){
 }
 my @planets;
 my $planet_id = undef;
+my $i = 0;
 while (my ($id,$coords,$planet,$race,$size,$score,$value,$xp,$sizerank,$scorerank,$valuerank,$xprank
                ,$fleetvalue,$resvalue,$planet_status,$hit_us,$alliance,$relationship,$nick) = $query->fetchrow){
        $planet_id = $id;
@@ -91,6 +92,8 @@ while (my ($id,$coords,$planet,$race,$size,$score,$value,$xp,$sizerank,$scoreran
                        $LOG->execute($ND::UID,"BC browsing ND planet $coords tick $ND::TICK");
                }
        }
+       $i++;
+       $planet{ODD} = $i % 2;
        push @planets,\%planet;
 }
 $BODY->param(Planets => \@planets);
index 5275d2165e1c23d1d63d6841e9f8390fd271bc5a..0310ea4d53bcdb98100976cf49947874880ccfda 100644 (file)
@@ -1,10 +1,10 @@
 <p><TMPL_IF Arbiter><TMPL_VAR NAME=Arbiter><TMPL_ELSE><a href="<TMPL_VAR NAME=PAGE>?cmd=arbiter&amp;coords=<TMPL_VAR ESCAPE=URL NAME=Coords>">Do arbiter check on gal</a></TMPL_IF></p>
-<table border="1">
+<table>
        <tr><th>Coords</th><th>Planet</th><th>Race</th><th>Size (rank)</th><th>Score (rank)</th><th>Value (rank)</th>
                <th>XP (rank)</th><th>Fleet (Resouce) value</th><TMPL_IF isBC><th>Nick</th><th>Hit us</th><th>Alliance</th></TMPL_IF>
        </tr>
        <TMPL_LOOP Planets>
-       <tr align="center">
+       <tr align="center" class="<TMPL_IF ODD>odd<TMPL_ELSE>even</TMPL_IF>">
                <td><a href="<TMPL_VAR NAME=PAGE>?coords=<TMPL_VAR NAME=Coords>"><TMPL_VAR NAME=Coords></a></td>
                <td><TMPL_VAR NAME=Planet></td><td><TMPL_VAR NAME=Race></td><td><TMPL_VAR NAME=Size></td>
                <td><TMPL_VAR NAME=Score></td><td><TMPL_VAR NAME=Value></td><td><TMPL_VAR NAME=XP></td>