<h3><%=l(:label_message_plural)%></h3>

<% active_msgs = Message.joins(:board).where("#{Board.table_name}.project_id IN (#{@user.projects.collect{|m| m.id}.join(',')})").limit(5).order("id DESC") %>
<table class=list boards">
  <thead>
        <tr><th><%= l(:label_board) %></th><th><%= l(:field_subject) %></th><th><%= l(:field_author) %></th><th><%= l(:field_created_on) %></th></tr>
  </thead>
  <tbody>
        <% active_msgs.each do |active_msgs| %>
                <tr class="<%= cycle 'odd', 'even' %>">
		<td><%= link_to h(active_msgs.board.name), {:controller => 'boards', :action => 'show', :id => active_msgs.board.id, :project_id => active_msgs.board.project}, :class => "board" %></td>
		<td><%= link_to h(active_msgs.subject), { :controller => 'messages', :action => 'show', :board_id => active_msgs.board.id, :id => active_msgs.id, :r => active_msgs, :anchor => "message-#{active_msgs.id}" } %>
                <td><%=h active_msgs.author %></td>
                <td><%= format_time(active_msgs.created_on) %></td>
                </tr>
        <% end %>
  </tbody>
</table>
