<div id="sidebar" class="navbar-inner span3">
	<ul class="nav nav-pills nav-stacked">
		<li class="nav-header" style="font-size:1.25em;margin-left:-10px;">Messages</li>
  		<li class="<%= get_nav_link_class('messages', MessagesController::SESSION_FILTER_TYPE_VAR, MessagesController::MESSAGE_TYPE_NEW) %>">
  			<%= link_to "New Messages (#{current_user.messages.where('to_user_id = ? AND opened_at IS NULL', current_user.id).count})", user_messages_path(current_user, :filter => MessagesController::MESSAGE_TYPE_NEW) %>
  		</li>
  		<li class="<%= get_nav_link_class('messages', MessagesController::SESSION_FILTER_TYPE_VAR, MessagesController::MESSAGE_TYPE_OLD) %>">
  			<%= link_to "Inbox", user_messages_path(current_user, :filter => MessagesController::MESSAGE_TYPE_OLD) %>
  		</li>
  		<li class="<%= get_nav_link_class('messages', MessagesController::SESSION_FILTER_TYPE_VAR, MessagesController::MESSAGE_TYPE_SENT) %>">
  			<%= link_to "Sent", user_messages_path(current_user, :filter => MessagesController::MESSAGE_TYPE_SENT) %>
  		</li>
	</ul>
</div>


<div id="sidebar" class="navbar-inner span3">
	<ul class="nav nav-pills nav-stacked">
		<li class="nav-header" style="font-size:1.25em;margin-left:-10px;">Messages</li>
  		<li class="<%= get_nav_link_class('messages', MessagesController::SESSION_FILTER_TYPE_VAR, MessagesController::MESSAGE_TYPE_NEW) %>">
  			<%= link_to "New Messages (#{Message.where('to_user_id = ? AND opened_at IS NULL', current_user.id).count})", user_messages_path(current_user, :filter => MessagesController::MESSAGE_TYPE_NEW) %>
  		</li>
  		<li class="<%= get_nav_link_class('messages', MessagesController::SESSION_FILTER_TYPE_VAR, MessagesController::MESSAGE_TYPE_OLD) %>">
  			<%= link_to "Inbox", user_messages_path(current_user, :filter => MessagesController::MESSAGE_TYPE_OLD) %>
  		</li>
  		<li class="<%= get_nav_link_class('messages', MessagesController::SESSION_FILTER_TYPE_VAR, MessagesController::MESSAGE_TYPE_SENT) %>">
  			<%= link_to "Sent", user_messages_path(current_user, :filter => MessagesController::MESSAGE_TYPE_SENT) %>
  		</li>
	</ul>
</div>


Fix count of new messages in sidebar
Fix count of new messages in sidebar
