Fixing mac index unauth

This commit is contained in:
Will Bradley 2014-11-20 13:22:39 -07:00
parent d522d0a43b
commit 40102775ea

View File

@ -29,15 +29,23 @@
<%= link_to 'Activity Graph', macs_history_path, :class => 'btn' if can? :read_details, Mac %> <%= link_to 'Activity Graph', macs_history_path, :class => 'btn' if can? :read_details, Mac %>
<ul class="mac_list"> <ul class="mac_list">
<% <% @active_macs.each do |mac| %>
@active_macs.each do |mac|
Rails.logger.info mac.inspect %>
<li> <li>
<%= link_to mac do %> <% if user_signed_in? %>
<span title="<%= mac.mac if user_signed_in? %><%= " - "+mac.ip.to_s if can? :read_details, mac %><%= " - "+((Time.now - mac.since) / 1.hour).round(1).to_s+" hours" if can? :manage, mac %>"> <%= link_to mac do %>
<%= mac.user.name unless mac.user.blank? %> <span title="<%= mac.mac if user_signed_in? %><%= " - "+mac.ip.to_s if can? :read_details, mac %><%= " - "+((Time.now - mac.since) / 1.hour).round(1).to_s+" hours" if can? :manage, mac %>">
<%= mac.mac if mac.user.blank? %> <%= mac.user.name unless mac.user.blank? %>
<%= "("+mac.note+")" unless mac.note.blank? %></span><% end %> &nbsp; <%= mac.mac if mac.user.blank? %>
<%= "("+mac.note+")" unless mac.note.blank? %>
</span>
<% end %> &nbsp;
<% else %>
<span>
<%= mac.user.name unless mac.user.blank? %>
<%= mac.mac if mac.user.blank? %>
<%= "("+mac.note+")" unless mac.note.blank? %>
</span>
<% end %>
<%= link_to ' Edit', edit_mac_path(mac) if can? :update, mac %> <br/> <%= link_to ' Edit', edit_mac_path(mac) if can? :update, mac %> <br/>
</li> </li>
<% end %> <% end %>