Changeset 450


Ignore:
Timestamp:
07/28/10 10:56:09 (14 years ago)
Author:
Kris Deugau
Message:

/branches/htmlform

Added missing index and footer templates
Update default CSS with definitions for footer, alternate-row colours
Have main.cgi look for a template matching $webvar{action}
Convert main summary page content to template
See #3.

Location:
branches/htmlform
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • branches/htmlform/cgi-bin/CommonWeb.pm

    r449 r450  
    6565        </center>
    6666        );
    67         print "<br>would print footer but already dun gone and shot($self->foot)\n";
     67        print "<br>would print footer but already dun gone and shot(self->foot)\n";
    6868        exit(0);
    6969}
  • branches/htmlform/cgi-bin/main.cgi

    r449 r450  
    6060        ));
    6161
    62 
    6362# Set up the CGI object...
    6463my $q = new CGI::Simple;
     
    7473
    7574if(!defined($webvar{action})) {
    76   $webvar{action} = "<NULL>";   #shuts up the warnings.
    77 }
     75  $webvar{action} = "index";    #shuts up the warnings.
     76}
     77
     78my $page = HTML::Template->new(filename => "$webvar{action}.tmpl");
    7879
    7980if($webvar{action} eq 'index') {
     
    182183#       if $IPDBacl{$authuser} =~ /A/;
    183184
     185print $page->output;
     186
    184187# We print the footer here, so we don't have to do it elsewhere.
    185188my $footer = HTML::Template->new(filename => "footer.tmpl");
     
    233236# Initial display:  Show master blocks with total allocated subnets, total free subnets
    234237sub showSummary {
    235 
    236   startTable('Master netblock', 'Routed netblocks', 'Allocated netblocks',
    237         'Free netblocks', 'Largest free block');
    238 
    239238  my %allocated;
    240239  my %free;
     
    276275  }
    277276
    278   # Print the data.
    279   my $count=0;
     277  # Assemble the data to stuff into the template.
     278  my @masterlist;
     279  my $rowclass=0;
    280280  foreach my $master (@masterblocks) {
    281     my @row = ("<a href=\"/ip/cgi-bin/main.cgi?action=showmaster&block=$master\">$master</a>",
    282         $routed{"$master"}, $allocated{"$master"}, $free{"$master"},
    283         ( ($bigfree{"$master"} eq '') ? ("&lt;NONE&gt;") : ("/".$bigfree{"$master"}) )
     281    my %row = (rowclass => "row$rowclass",
     282        master => "$master",
     283        routed => $routed{"$master"},
     284        allocated => $allocated{"$master"},
     285        free => $free{"$master"},
     286        bigfree => ( ($bigfree{"$master"} eq '') ? ("&lt;NONE&gt;") : ("/".$bigfree{"$master"}) )
    284287        );
    285 
    286     printRow(\@row, 'color1' ) if($count%2==0);
    287     printRow(\@row, 'color2' ) if($count%2!=0);
    288     $count++;
    289   }
    290   print "</table>\n";
    291   if ($IPDBacl{$authuser} =~ /a/) {
    292     print qq(<a href="/ip/cgi-bin/main.cgi?action=addmaster">Add new master block</a><br><br>\n);
    293   }
    294   print "Note:  Free blocks noted here include both routed and unrouted blocks.\n";
     288    push (@masterlist, \%row);
     289    $rowclass++;  $rowclass = $rowclass % 2;
     290  }
     291  $page->param(masterlist => \@masterlist);
     292
     293  $page->param(addmaster => ($IPDBacl{$authuser} =~ /a/) );
    295294
    296295} # showSummary
  • branches/htmlform/ipdb.css

    r413 r450  
     1/* Specific divs */
     2#adminlink {
     3        position: absolute;
     4        right: 10px;
     5        bottom: 5px;
     6}
     7#footer {
     8        border-top: thin solid #000000;
     9}
     10#contact {
     11        font-size: 10px;
     12        position: absolute;
     13        right: 10px;
     14        text-align: right;
     15}
     16
    117body {
    218  background-color: #ffffff;
     
    1228a:active        { color:#cc0000; }      /* selected link */
    1329
     30/* Defs for bulk-data rows */
     31tr.header {
     32        background-color: #CCCCCC;
     33        font-family: Verdana, Arial, Helvetica, sans-serif;
     34}
     35tr.row0 {
     36        background-color: #A8C4D0;
     37        font-family: Verdana, Arial, Helvetica, sans-serif;
     38        font-size: 90%;
     39}
     40tr.row1 {
     41        background-color: #d0e0e0;
     42        font-family: Verdana, Arial, Helvetica, sans-serif;
     43        font-size: 90%;
     44}
     45
     46/* legacy defs */
    1447tr.color0 {
    1548        background-color: #A8C4D0;
Note: See TracChangeset for help on using the changeset viewer.