| 
        [% IF row.up_admin == 'down' %]
        S
        [% ELSIF row.stp == 'blocking' %]
        B
        [% ELSIF params.free OR row.is_free %]
        F
        [% ELSIF row.up_admin == 'up' AND row.up == 'down' %]
        D
        [% END %]
       | 
      [% FOREACH config IN settings._extra_device_port_cols %]
        [% NEXT UNLESS config.position == 'left' AND params.${config.name} %]
        
          [% TRY %]
          [% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
          [% CATCH %]
          
          [% END %]
         | 
      [% END %]
      [% IF params.c_port %]
      [% IF vars.user.port_control AND params.c_admin %]
      [% IF row.up_admin == 'up' %]
      
        
      [% ELSE %]
       | 
        
      [% END %]
      [% ELSE %]
       | 
      [% END %]
        
        [% row.port | html_entity %]
       | 
      [% END %]
      [% FOREACH config IN settings._extra_device_port_cols %]
        [% NEXT UNLESS config.position == 'mid' AND params.${config.name} %]
        
          [% TRY %]
          [% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
          [% CATCH %]
          
          [% END %]
         | 
      [% END %]
      [% IF params.c_descr %]
      [% row.descr | html_entity %] | 
      [% END %]
      [% IF params.c_type %]
      [% row.type | html_entity %] | 
      [% END %]
      [% IF params.c_duplex %]
      
        [% IF row.up == 'up' AND row.duplex %]
        [% row.duplex_admin.ucfirst | html_entity %] / [% row.duplex.ucfirst | html_entity %]
        [% END %]
       | 
      [% END %]
      [% IF params.c_lastchange %]
      [% row.lastchange_stamp | html_entity %] | 
      [% END %]
      [% IF params.c_name %]
      [% IF vars.user.port_control AND params.c_admin %]
      
      
      [% ELSE %]
       | 
      [% END %]
       
        [% row.name | html_entity %]
       
       | 
      [% END %]
      [% IF params.c_speed %]
      [% row.speed | html_entity %] | 
      [% END %]
      [% IF params.c_mac %]
      [% row.mac | html_entity %] | 
      [% END %]
      [% IF params.c_mtu %]
      [% row.mtu | html_entity %] | 
      [% END %]
      [% IF params.c_vlan %]
      [% IF vars.user.port_control AND params.c_admin %]
      
      
       
        [% IF row.vlan %][% row.vlan | html_entity %][% END %]
       
       | 
      [% ELSE %]
      
        
            [% row.vlan | html_entity %]
       | 
      [% END %]
      [% END %]
      [% IF params.c_vmember %]
      
        [% IF row.tagged_vlans_count %]
        [% SET output = '' %]
        [% FOREACH vlan IN row.tagged_vlans %]
          [% SET output = output _
            '' _ vlan.vlan _ '' %]
          [% SET output = output _ ', ' IF NOT loop.last %]
        [% END %]
        [% IF row.tagged_vlans_count > 10 %] [%# TODO make this a settable variable %]
          [% SET output = ' (' _ row.tagged_vlans_count
            _ ') 
              Show VLANs
              ' _ output %]
          [% SET output = output _ ' ' %]
        [% END %]
        [% output %]
        [% END %]
       | 
      [% END %]
      [% IF params.c_power %]
        [% IF row.power %]
          [% IF row.power.admin == 'true' %]
            [% IF vars.user.port_control AND params.c_admin %]
              
                
            [% ELSE %]
               | 
                
            [% END %]
                
                [% IF row.power.power > 0 %]
                  [% row.power.power | html_entity %] mW
                [% ELSE %]
                  ([% row.power.status | html_entity %])
                [% END %]
                
          [% ELSE %]
            [% IF vars.user.port_control AND params.c_admin %]
               | 
                
            [% ELSE %]
               | 
                
            [% END %]
          [% END %]
               | 
        [% ELSE %]
           | 
        [% END %]
      [% END %]
      [% IF params.c_nodes OR params.c_neighbors %]
      
        [% IF params.c_neighbors AND (row.remote_ip OR row.is_uplink) %]
          [% IF row.neighbor %]
          
            [% row.neighbor.dns.remove(settings.domain_suffix) || row.neighbor.ip | html_entity %]
            ([% row.remote_port | html_entity %])
          [% ELSIF row.remote_ip AND row.remote_port %]
          N
          
            [% row.remote_ip | html_entity %] (port: [% row.remote_port | html_entity %]
            [% ' id: '_ row.remote_type IF row.remote_type%]
            [% ' type: '_ row.remote_id IF row.remote_id%])
          [% ELSE %]
          N (probable neighbor)
          [% END %]
        [% END %]
        [% IF params.c_nodes %]
        [% FOREACH node IN row.$nodes %]
          [% ' ' IF (row.remote_ip OR row.is_uplink) OR NOT loop.first %]
          [% 'A  ' IF NOT node.active %]
          
            [% node.net_mac.$mac_format_call | html_entity %]
          [% ' (' _ node.time_last_age _ ')' IF params.n_age %]
          [% IF params.n_ip %]
            [% FOREACH ip IN node.ips %]
               [% 'A  ' IF NOT ip.active %]
              [% SET dns = ip.dns %]
              [% IF dns %]
              [% dns %] ([% ip.ip | html_entity %])
              [% ELSE %]
              [% ip.ip | html_entity %]
              [% END %]
            [% END %]
          [% END %]
        [% END %]
        [% END %]
       | 
      [% END %]
      [% IF params.c_stp %]
      [% row.stp | html_entity %] | 
      [% END %]
      [% IF params.c_up %]
      
        [% row.up_admin.ucfirst | html_entity %] / [% row.up.ucfirst | html_entity %]
       | 
      [% END %]
      [% FOREACH config IN settings._extra_device_port_cols %]
        [% NEXT UNLESS config.position == 'right' AND params.${config.name} %]
        
          [% TRY %]
          [% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
          [% CATCH %]
          
          [% END %]
         | 
      [% END %]
    
    [% END %]