[freeside-commits] freeside/httemplate/browse router.cgi, 1.10, 1.11 addr_block.cgi, 1.6, 1.7
Ivan,,,
ivan at wavetail.420.am
Sat Mar 15 21:54:40 PDT 2008
Update of /home/cvs/cvsroot/freeside/httemplate/browse
In directory wavetail.420.am:/tmp/cvs-serv12323
Modified Files:
router.cgi addr_block.cgi
Log Message:
drag address & router browse into this centiry
Index: router.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/router.cgi,v
retrieving revision 1.10
retrieving revision 1.11
diff -u -d -r1.10 -r1.11
--- router.cgi 13 Jan 2008 20:38:30 -0000 1.10
+++ router.cgi 16 Mar 2008 04:54:38 -0000 1.11
@@ -16,11 +16,16 @@
<A HREF="<%$p2%>edit/router.cgi">Add a new router</A> | <%$hideurl%>
-<%table()%>
+<% include('/elements/table-grid.html') %>
+% my $bgcolor1 = '#eeeeee';
+% my $bgcolor2 = '#ffffff';
+% my $bgcolor = '';
+
<TR>
- <TD><B>Router name</B></TD>
- <TD><B>Address block(s)</B></TD>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Router name</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Address block(s)</TH>
</TR>
+
% foreach my $router (sort {$a->routernum <=> $b->routernum} @router) {
% next if $hidecustomerrouters && $router->svcnum;
% my @addr_block = $router->addr_block;
@@ -28,20 +33,32 @@
% push @addr_block, ' ';
% }
%
+% if ( $bgcolor eq $bgcolor1 ) {
+% $bgcolor = $bgcolor2;
+% } else {
+% $bgcolor = $bgcolor1;
+% }
<TR>
- <TD ROWSPAN="<%scalar(@addr_block)+1%>">
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
<A HREF="<%$p2%>edit/router.cgi?<%$router->routernum%>"><%$router->routername%></A>
</TD>
- </TR>
-% foreach my $block ( @addr_block ) {
- <TR>
- <TD><%UNIVERSAL::isa($block, 'FS::addr_block') ? $block->NetAddr : ' '%></TD>
- </TR>
-% }
+ <TD CLASS="inv" BGCOLOR="<% $bgcolor %>">
+ <TABLE CLASS="inv" CELLSPACING=0 CELLPADDING=0>
+
+% foreach my $block ( @addr_block ) {
+
+ <TR>
+ <TD><%UNIVERSAL::isa($block, 'FS::addr_block') ? $block->NetAddr : ' '%></TD>
+ </TR>
+% }
+ </TABLE>
+ </TD>
</TR>
+
% }
</TABLE>
Index: addr_block.cgi
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/browse/addr_block.cgi,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -d -r1.6 -r1.7
--- addr_block.cgi 13 Jan 2008 20:38:29 -0000 1.6
+++ addr_block.cgi 16 Mar 2008 04:54:38 -0000 1.7
@@ -2,70 +2,81 @@
<% include('/elements/error.html') %>
-<%table()%>
-% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) {
+<% include('/elements/table-grid.html') %>
+% my $bgcolor1 = '#eeeeee';
+% my $bgcolor2 = '#ffffff';
+% my $bgcolor = '';
<TR>
- <TD><%$block->NetAddr%></TD>
-% if (my $router = $block->router) {
-% if (scalar($block->svc_broadband) == 0) {
+ <TH CLASS="grid" BGCOLOR="#cccccc">Address block(s)</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Router</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc">Action(s)</TH>
+ </TR>
- <TD>
- <%$router->routername%>
- </TD>
- <TD>
- <FORM ACTION="<%$path%>/deallocate.cgi" METHOD="POST">
- <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%$block->blocknum%>">
- <INPUT TYPE="submit" NAME="submit" VALUE="Deallocate">
- </FORM>
- </TD>
-% } else {
+% foreach $block (sort {$a->NetAddr cmp $b->NetAddr} @addr_block) {
+% if ( $bgcolor eq $bgcolor1 ) {
+% $bgcolor = $bgcolor2;
+% } else {
+% $bgcolor = $bgcolor1;
+% }
- <TD COLSPAN="2">
- <%$router->routername%>
- </TD>
-% }
-% } else {
+ <TR>
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>"><%$block->NetAddr%></TD>
- <TD>
- <FORM ACTION="<%$path%>/allocate.cgi" METHOD="POST">
- <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%$block->blocknum%>">
- <SELECT NAME="routernum" SIZE="1">
-% foreach (@router) {
+% if (my $router = $block->router) {
+%
+% if (scalar($block->svc_broadband) == 0) {
- <OPTION VALUE="<%$_->routernum %>"><%$_->routername%></OPTION>
-% }
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <%$router->routername%>
+ </TD>
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <FORM ACTION="<%$path%>/deallocate.cgi" METHOD="POST">
+ <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%$block->blocknum%>">
+ <INPUT TYPE="submit" NAME="submit" VALUE="Deallocate">
+ </FORM>
+ </TD>
+% } else {
+
+ <TD COLSPAN="2" CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <%$router->routername%>
+ </TD>
+% }
+%
+% } else {
+
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <FORM ACTION="<%$path%>/allocate.cgi" METHOD="POST">
+ <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%$block->blocknum%>">
+ <SELECT NAME="routernum" SIZE="1">
+% foreach (@router) {
+ <OPTION VALUE="<%$_->routernum %>"><%$_->routername%></OPTION>
+% }
+ </SELECT>
+ <INPUT TYPE="submit" NAME="submit" VALUE="Allocate">
+ </FORM>
+ </TD>
+ <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
+ <FORM ACTION="<%$path%>/split.cgi" METHOD="POST">
+ <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%$block->blocknum%>">
+ <INPUT TYPE="submit" NAME="submit" VALUE="Split">
+ </FORM>
+ </TD>
+
+% }
- </SELECT>
- <INPUT TYPE="submit" NAME="submit" VALUE="Allocate">
- </FORM>
- </TD>
- <TD>
- <FORM ACTION="<%$path%>/split.cgi" METHOD="POST">
- <INPUT TYPE="hidden" NAME="blocknum" VALUE="<%$block->blocknum%>">
- <INPUT TYPE="submit" NAME="submit" VALUE="Split">
- </FORM>
- </TD>
</TR>
-% }
% }
- <TR><TD COLSPAN="3"><BR></TD></TR>
- <TR>
- <FORM ACTION="<%$path%>/add.cgi" METHOD="POST">
- <TD>Gateway/Netmask</TD>
- <TD>
- <INPUT TYPE="text" NAME="ip_gateway" SIZE="15">/<INPUT TYPE="text" NAME="ip_netmask" SIZE="2">
- </TD>
- <TD>
- <INPUT TYPE="submit" NAME="submit" VALUE="Add">
- </TD>
- </FORM>
- </TR>
</TABLE>
-<% include('/elements/footer.html') %>
+<BR><BR>
+<FORM ACTION="<%$path%>/add.cgi" METHOD="POST">
+Gateway/Netmask:
+<INPUT TYPE="text" NAME="ip_gateway" SIZE="15">/<INPUT TYPE="text" NAME="ip_netmask" SIZE="2">
+<INPUT TYPE="submit" NAME="submit" VALUE="Add">
+<% include('/elements/footer.html') %>
<%init>
die "access denied"
More information about the freeside-commits
mailing list