Changeset 818 for trunk/cgi-bin/main.cgi


Ignore:
Timestamp:
03/10/16 18:02:41 (9 years ago)
Author:
Kris Deugau
Message:

/trunk

Introduce a more "relaxed" layout for listing VRFs and master netblocks -
interleave the lists of master blocks for each VRF with the VRF heading,
instead of formally separating them onto different pages.

Refine and adapt showvrfs.tmpl to show the master blocks instead of
reinventing another wheel.

See #54.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/main.cgi

    r816 r818  
    319319sub showSummary {
    320320  my $vrflist = listVRF($ip_dbh);
     321
     322  if ($IPDB::masterswithvrfs == 2) {
     323    $page = HTML::Template->new(filename => "index2.tmpl", loop_context_vars => 1, global_vars => 1,
     324        path => @templatepath);
     325    # alternate layout;  put master blocks on the front summary page instead of "out"/"down" a
     326    # layer in the browse tree
     327    my $vrfinfo = HTML::Template->new(filename => "showvrf.tmpl", path => @templatepath);
     328    foreach my $vrf (@$vrflist) {
     329      my $masterlist = listSummary($ip_dbh, $vrf->{vrf});
     330      $vrfinfo->param(vrf => $vrf->{vrf});
     331      $vrfinfo->param(masterlist => $masterlist);
     332      $vrfinfo->param(addmaster => ($IPDBacl{$authuser} =~ /s/) );
     333      $vrfinfo->param(maydel => ($IPDBacl{$authuser} =~ /s/) );
     334      $vrfinfo->param(sub => 1);
     335      $vrf->{vrfinfo} = $vrfinfo->output;
     336    }
     337  }
     338
    321339  $page->param(vrflist => $vrflist);
    322340
    323341  # Only systems/network should be allowed to add VRFs - or maybe higher?
    324342  $page->param(addvrf => ($IPDBacl{$authuser} =~ /s/) );
     343
    325344} # showSummary
    326345
     
    338357  $utilbar->param(breadcrumb => \@rcrumbs);
    339358
     359  $page->param(maydel => ($IPDBacl{$authuser} =~ /s/) );
    340360  $page->param(addmaster => ($IPDBacl{$authuser} =~ /s/) );
    341361} # showVRF
Note: See TracChangeset for help on using the changeset viewer.