+%if ( @devices || $num_part_device || $table eq 'dsl_device' ) {
+% my $svcnum = $svc_x->svcnum;
+
+ <FONT CLASS="fsinnerbox-title">Devices</FONT>
+ (<A HREF="<%$p%>edit/<%$table%>.html?svcnum=<%$svcnum%>">Add device</A>)
+ <BR>
+
+% if ( @devices ) {
+
+ <SCRIPT>
+ function areyousure(href) {
+ if (confirm("Are you sure you want to delete this device?") == true)
+ window.location.href = href;
+ }
+ </SCRIPT>
+
+ <& /elements/table-grid.html &>
+ <TR>
+% if ( $table ne 'dsl_device' ) { # ( $table eq 'phone_device' || $table eq 'cable_device' || $table eq 'pbx_device' ) {
+ <TH CLASS="grid" BGCOLOR="#cccccc">Type</TH>
+% }
+ <TH CLASS="grid" BGCOLOR="#cccccc">MAC Addr</TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
+ <TH CLASS="grid" BGCOLOR="#cccccc"></TH>
+ </TR>
+
+% my $bgcolor1 = '#eeeeee';
+% my $bgcolor2 = '#ffffff';
+% my $bgcolor = '';
+%
+% foreach my $device ( @devices ) {
+%
+% if ( $bgcolor eq $bgcolor1 ) {
+% $bgcolor = $bgcolor2;
+% } else {
+% $bgcolor = $bgcolor1;
+% }
+%
+% my $td = qq(<TD CLASS="grid" BGCOLOR="$bgcolor">);
+%
+% my $devicenum = $device->devicenum;
+% my $export_links = '';
+% $export_links = join( '<BR>', @{ $device->export_links } )
+% if $device->can('export_links');
+
+ <TR>
+% #$devices->can('part_device')
+% if ( $table eq 'phone_device' || $svc_x->isa('FS::device_Common') ) {
+ <% $td %><% $device->part_device->devicename |h %></TD>
+% }
+ <% $td %><% $device->mac_addr_pretty %>
+% my $vendor = Net::MAC::Vendor::lookup($device->mac_addr_formatted('U',':'));
+ (<% $vendor ? $vendor->[0] : '' %>)
+ </TD>
+ <% $td %><% $export_links %></TD>
+ <% $td %>(
+% unless ( $opt{'no_edit'} ) {
+ <A HREF="<%$p%>edit/<%$table%>.html?<%$devicenum%>">edit</A> |
+% }
+ <A HREF="javascript:areyousure('<%$p%>misc/delete-<%$table%>.html?<%$devicenum%>')">delete</A>
+ )</TD>
+ </TR>
+% }
+ </TABLE>
+ <BR>
+
+% }
+ <BR>
+%}