Changeset 254

Show
Ignore:
Timestamp:
09/01/08 13:51:55 (4 months ago)
Author:
pwh
Message:

Move device_information_box() out of application_helper.rb and include the partial directly in the search view.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • nethorus/app/helpers/application_helper.rb

    r234 r254  
    172172 
    173173 
    174   # Output information and links about a specified device 
    175  
    176   def device_information_box(device) 
    177  
    178     render :partial => "common/device_information_box", :locals => { :device => device } 
    179  
    180   end 
    181  
    182  
    183174  # Output a value or "Unavailable" if it is nil 
    184175 
  • nethorus/app/views/search/index.html.erb

    r178 r254  
    3131   <% for device in @devices %> 
    3232    <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
    33      <td><%= device_information_box(device) %></td> 
     33     <td><%= render :partial => "common/device_information_box", :locals => { :device => device } %></td> 
    3434     <td>Device</td> 
    3535     <td>Matched hostname</td> 
     
    4040   <% for l2_interface in @l2_interfaces_long %> 
    4141    <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
    42      <td><%= device_information_box(l2_interface.device) %></td> 
     42     <td><%= render :partial => "common/device_information_box", :locals => { :device => l2_interface.device } %></td> 
    4343     <td>Interface <strong><%= link_to l2_interface.ifdescr_short, :controller => 'manage', :action => 'interface', :device_id => l2_interface.device.id, :interface_id => l2_interface.id %></strong></td> 
    4444     <td>Description is <strong><%=h l2_interface.ifdescr_long %></strong></td> 
     
    4949   <% for l2_interface in @l2_interfaces_short %> 
    5050    <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
    51      <td><%= device_information_box(l2_interface.device) %></td> 
     51     <td><%= render :partial => "common/device_information_box", :locals => { :device => l2_interface.device } %></td> 
    5252     <td>Interface <strong><%= link_to l2_interface.ifdescr_short, :controller => 'manage', :action => 'interface', :device_id => l2_interface.device.id, :interface_id => l2_interface.id %></strong></td> 
    5353     <td>Matched on interface name</td> 
     
    5858   <% for l3_interface in @l3_interfaces_exact %> 
    5959    <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
    60      <td><%= device_information_box(l3_interface.l2_interface.device) %></td> 
     60     <td><%= render :partial => "common/device_information_box", :locals => { :device => l3_interface.l2_interface.device } %></td> 
    6161     <td>Interface <strong><%=h l3_interface.l2_interface.ifdescr_short %></strong></td> 
    6262     <td>Exact match on IPv4 address</td> 
     
    6666   <% for l2_interface in @l2_interfaces_address %> 
    6767    <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
    68      <td><%= device_information_box(l2_interface.device) %></td> 
     68     <td><%= render :partial => "common/device_information_box", :locals => { :device => l2_interface.device } %></td> 
    6969     <td>Interface <strong><%=h l2_interface.ifdescr_short %></strong></td> 
    7070     <td>Exact match on Layer 2 address</td> 
     
    7474   <% for element in @element_serial %> 
    7575    <tr class="<%= cycle('even_row', 'odd_row', :name => 'row_class') %>"> 
    76      <td><%= device_information_box(element.device) %></td> 
     76     <td><%= render :partial => "common/device_information_box", :locals => { :device => element.device } %></td> 
    7777     <td>Element <strong><%=h element.phys_description %> (a <%=h element.phys_class %>)</strong></td> 
    7878     <td>Exact match on serial number</td> 
  • nethorus/test/unit/application_helper_test.rb

    r234 r254  
    4444 
    4545 
    46   # Test the device_information_box function 
    47    
    48   def test_device_information_box 
    49    
    50     # TODO: Write tests for device_information_box 
    51    
    52   end 
    53  
    54  
    5546  # Test the ipv4_network_name function 
    5647