<% representations = current_user.represented.unshift(current_user) - [current_subject] %>
<% unless representations.empty? %>
<li>
  <%= link_to t('representation.switch'), "javascript:;", :class=>"session_change" %>
  <ul>
    <% representations.each do |representation| %>
    <li>
      <%= link_to truncate_name(representation.name, :length => 15) + (content_tag(:span, representation.pending_contacts_count.to_s, :class => "switch_pending_count") if representation.pending_contacts_count > 0), { :s => representation.slug }, { :style => "background: transparent url('#{ image_path representation.logo.url(:representation)}') no-repeat left center;margin-left:2px;" } %>
    </li>
    <% end %>
  </ul>
</li>
<% end %> 

<% representations = current_user.represented.unshift(current_user) - [current_subject] %>
<% unless representations.empty? %>
<li>
  <%= link_to t('representation.switch'), "javascript:;", :class=>"session_change" %>
  <ul>
    <% representations.each do |representation| %>
    <li>
      <%  pending_total = representation.mailbox.notifications.not_trashed.unread.count %>
      <%= link_to truncate_name(representation.name, :length => 15) + (content_tag(:span, pending_total.to_s, :class => "switch_pending_count") if pending_total > 0), { :s => representation.slug }, { :style => "background: transparent url('#{ image_path representation.logo.url(:representation)}') no-repeat left center;margin-left:2px;" } %>
    </li>
    <% end %>
  </ul>
</li>
<% end %> 

Change session menu to include unread notifications rather than pending contacts
Change session menu to include unread notifications rather than pending contacts
