Changeset 212

Show
Ignore:
Timestamp:
08/03/08 22:57:05 (4 months ago)
Author:
pwh
Message:
  • Display a suitable message if no bridge have been recorded.
Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/views/bridge_management/_all_bridges.html.erb

    r200 r212  
    1 <table class="vert"> 
    2  <tr> 
    3   <th>Hostname</th> 
    4   <th>Bridge address</th> 
    5   <th>Root bridge</th> 
    6  </tr> 
    7  <%- for bridge in @bridges -%> 
    8   <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
    9   <td> 
    10    <%=h bridge.device.hostname %> 
    11   </td> 
    12   <td> 
    13    <%= link_to bridge.dot1d_base_bridge_address, :controller => 'bridge_management', :action => 'show_bridge', :bridge_id => bridge.id %> 
    14   </td> 
    15   <td> 
    16    <%= link_to bridge.dot1d_stp_designated_root, :controller => 'bridge_management', :action => 'show_spanning_tree', :stp_root => bridge.dot1d_stp_designated_root  %> 
    17   </td> 
    18  </tr> 
     1<%- if @bridges.count == 0 -%> 
     2 <p>No bridges have been recorded.  Please inventory a device with a bridge from the Management page.</p> 
     3<%- else -%> 
     4 <table class="vert"> 
     5  <tr> 
     6   <th>Hostname</th> 
     7   <th>Bridge address</th> 
     8   <th>Root bridge</th> 
     9  </tr> 
     10  <%- for bridge in @bridges -%> 
     11   <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
     12   <td> 
     13    <%=h bridge.device.hostname %> 
     14   </td> 
     15   <td> 
     16    <%= link_to bridge.dot1d_base_bridge_address, :controller => 'bridge_management', :action => 'show_bridge', :bridge_id => bridge.id %> 
     17   </td> 
     18   <td> 
     19    <%= link_to bridge.dot1d_stp_designated_root, :controller => 'bridge_management', :action => 'show_spanning_tree', :stp_root => bridge.dot1d_stp_designated_root  %> 
     20   </td> 
     21  </tr> 
     22  <%- end -%> 
    1923 <%- end -%> 
    2024</table>