Changeset 478
- Timestamp:
- 08/27/10 17:56:58 (14 years ago)
- Location:
- branches/htmlform
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/htmlform/cgi-bin/main.cgi
r477 r478 29 29 openlog "IPDB","pid","$IPDB::syslog_facility"; 30 30 31 ## Environment. Collect some things, process some things, set some things... 32 31 33 # Collect the username from HTTP auth. If undefined, we're in 32 34 # a test environment, or called without a username. … … 37 39 $authuser = $ENV{'REMOTE_USER'}; 38 40 } 41 42 # anyone got a better name? :P 43 my $thingroot = $ENV{SCRIPT_FILENAME}; 44 $thingroot =~ s|cgi-bin/main.cgi||; 39 45 40 46 syslog "debug", "$authuser active, $ENV{'REMOTE_ADDR'}"; … … 52 58 53 59 # Set up some globals 54 ##fixme - need to autofill this somehow 55 $ENV{HTML_TEMPLATE_ROOT} = '/home/kdeugau/dev/ipdb/trunk/templates'; 60 $ENV{HTML_TEMPLATE_ROOT} = $thingroot."templates"; 56 61 57 62 my $header = HTML::Template->new(filename => "header.tmpl"); … … 272 277 my $rowclass=0; 273 278 foreach my $master (@masterblocks) { 274 my %row = (rowclass => "row$rowclass", 279 my %row = ( 280 rowclass => $rowclass++ % 2, 275 281 master => "$master", 276 282 routed => $routed{"$master"}, … … 280 286 ); 281 287 push (@masterlist, \%row); 282 $rowclass++; $rowclass = $rowclass % 2;283 288 } 284 289 $page->param(masterlist => \@masterlist); … … 354 359 foreach my $master (@localmasters) { 355 360 my %row = ( 356 rowclass => $rowclass % 2,361 rowclass => $rowclass++ % 2, 357 362 block => "$master", 358 363 city => $cities{"$master"}, … … 362 367 ); 363 368 push @routed, \%row; 364 $rowclass++;365 369 } 366 370 $page->param(routedlist => \@routed); … … 380 384 my $cidr = new NetAddr::IP $data[0]; 381 385 my %row = ( 382 rowclass => $rowclass % 2,386 rowclass => $rowclass++ % 2, 383 387 fblock => "$cidr", 384 388 frange => $cidr->range 385 389 ); 386 390 push @unrouted, \%row; 387 $rowclass++;388 391 } 389 392 $page->param(unrouted => \@unrouted); -
branches/htmlform/cgi-bin/search.cgi
r468 r478 470 470 "&pool=$data[0]\">List IPs</a>"; 471 471 } 472 printRow(\@row, 'color1', 1) if ($count%2==0); 473 printRow(\@row, 'color2', 1) if ($count%2!=0); 474 $count++; 472 printRow(\@row, "row".($count++ % 2), 1); 475 473 } 476 474 -
branches/htmlform/templates/index.tmpl
r466 r478 10 10 </tr> 11 11 <TMPL_LOOP NAME=masterlist> 12 <tr class=" <TMPL_VAR name=rowclass>">12 <tr class="row<TMPL_VAR name=rowclass>"> 13 13 <td><a href="/ip/cgi-bin/main.cgi?action=showmaster&block=<TMPL_VAR NAME=master>"><TMPL_VAR NAME=master></a></td> 14 14 <td><TMPL_VAR NAME=routed></td>
Note:
See TracChangeset
for help on using the changeset viewer.