X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e6af088dda8e85f53b11ffbaddb11edf08e4a046..8181cb4bf77548088f959562f24be17f8ec053a3:/app/views/message/inbox.rhtml
diff --git a/app/views/message/inbox.rhtml b/app/views/message/inbox.rhtml
index daae9cd64..2a64f2774 100644
--- a/app/views/message/inbox.rhtml
+++ b/app/views/message/inbox.rhtml
@@ -1,51 +1,20 @@
-
My inbox
+My inbox/<%= link_to "outbox", url_for(:controller => "user", :action => "outbox", :id => @user.display_name) %>
-You have <%=@user.get_new_messages.length %> new messages and <%=@user.get_all_messages.length - @user.get_new_messages.length %> old messages
+You have <%= @user.new_messages.size %> new messages and <%= @user.messages.size - @user.new_messages.size %> old messages
-<% if (params[:all] and @user.get_all_messages.length > 0) or (@user.get_new_messages.length > 0) %>
+<% if @user.messages.size > 0 %>
-
- from |
- title |
- received on |
- |
- |
-
- <% if params[:all] %>
- <% @user.get_all_messages.each do |message| %>
- <%= link_to User.find(message.from_user_id).display_name , :controller => 'user', :action => User.find(message.from_user_id).display_name %> |
- <%= link_to message.title , :controller => 'message', :action => 'read', :message_id => message.id %> |
- <%= message.sent_on %> |
- <% if message.message_read = 0 %>
- <%= link_to 'mark as read', :controller => 'message', :action => 'mark', :message_id => message.id %> |
- <%else%>
- message read |
- <%end%>
- <%= link_to 'reply', :controller => 'message', :action => 'new', :user_id => message.from_user_id %> |
-
- <%end%>
-
- <%else%>
-
- <% @user.get_new_messages.each do |message| %>
- <%= link_to User.find(message.from_user_id).display_name , :controller => 'user', :action => User.find(message.from_user_id).display_name %> |
- <%= link_to message.title , :controller => 'message', :action => 'read', :message_id => message.id %> |
- <%= message.sent_on %> |
- <% if message.message_read = 0 %>
- <%= link_to 'mark as read', :controller => 'message', :action => 'mark', :message_id => message.id %> |
- <%else%>
- message read |
- <%end%>
-
- <%end%>
- <%end%>
-
-
-
-<%end%>
-
-<% if params[:all] %>
- <%= link_to 'show new messages', :controller => 'message', :action => 'inbox', :display_name => @user.display_name %>
+
+
+ From |
+ Subject |
+ Date |
+ |
+ |
+
+ <%= render :partial => "message_summary", :collection => @user.messages %>
+
+
<% else %>
- <%= link_to 'show all messages', :controller => 'message', :action => 'inbox', :display_name => @user.display_name, :all => true %>
-<% end %>
\ No newline at end of file
+ You have no messages yet. Why not get in touch with some of the <%= link_to 'people mapping nearby', :controller => 'user', :action => 'view', :display_name => @user.display_name %>?
+<% end %>