3 <p>You have <%=@user.get_new_messages.length %> new messages and <%=@user.get_all_messages.length - @user.get_new_messages.length %> old messages</p>
5 <% if (params[:all] and @user.get_all_messages.length > 0) or (@user.get_new_messages.length > 0) %>
7 <table class="messages">
15 <% @user.get_all_messages.each do |message| %>
16 <tr><td><%= link_to User.find(message.from_user_id).display_name , :controller => 'user', :action => User.find(message.from_user_id).display_name %></td>
17 <td><%= link_to message.title , :controller => 'message', :action => 'read', :message_id => message.id %></td>
18 <td><%= message.sent_on %></td>
19 <% if message.message_read = 0 %>
20 <td><%= link_to 'mark as read', :controller => 'message', :action => 'mark', :message_id => message.id %> </td>
24 <td><%= link_to 'reply', :controller => 'message', :action => 'new', :user_id => message.from_user_id %> </td>
30 <% @user.get_new_messages.each do |message| %>
31 <tr><td><%= link_to User.find(message.from_user_id).display_name , :controller => 'user', :action => User.find(message.from_user_id).display_name %></td>
32 <td><%= link_to message.title , :controller => 'message', :action => 'read', :message_id => message.id %></td>
33 <td><%= message.sent_on %></td>
34 <% if message.message_read = 0 %>
35 <td><%= link_to 'mark as read', :controller => 'message', :action => 'mark', :message_id => message.id %> </td>
48 <%= link_to 'show new messages', :controller => 'message', :action => 'inbox', :display_name => @user.display_name %>
50 <%= link_to 'show all messages', :controller => 'message', :action => 'inbox', :display_name => @user.display_name, :all => true %>