<%= l(:label_activity) %>

<%= javascript_include_tag "jquery.infinitescroll.js" %>
<% unless @events_pages.empty? %> <% @events_pages.each do |e| -%> <% if e.forge_act_type == "ProjectCreateInfo"%>
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
<%= link_to_user(e.user)%> <%= l(:label_project_new) %> <%= link_to e.project.name %> !
<%= l :label_create_time %>: <%= format_time(e.created_at) %>
<% end %> <% next if e.forge_act_type.safe_constantize.nil? act = e.forge_act; next if act.nil? %> <% if e.forge_act_type == "Issue" %>
<%= image_tag(url_to_avatar(act.author), :class => "avatar") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to_user(act.author) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.source_from}##{act.project_issues_index} (#{act.status}): #{act.tracker.name} #{act.subject}"), {:controller => 'issues', :action => 'show', :id => act.id} %>
<%= textAreailizable act,:description %>
<%= l :label_activity_time %> :  <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
<%= link_to l(:label_find_all_comments), issue_path(act.id) %> <%= l(:label_comments_count, :count => act.journals.count) %>
<% elsif e.forge_act_type == "Journal" %>
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to(l(:label_activity_project)+act.issue.project.name, project_path(act.issue.project.id)) %> <%= link_to format_activity_title("#{act.issue.tracker} ##{act.issue.project_issues_index}: #{act.issue.subject}"), {:controller => 'issues', :action => 'show', :id => act.issue.id, :anchor => "change-#{act.id}"} %>
<%= textAreailizable act,:notes %>
<%= l :label_activity_time %> :  <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
<% elsif e.forge_act_type == "Message" %>
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), {:controller => 'messages', :action => 'show', :board_id => act.board_id}.merge(act.parent_id.nil? ? {:id => act.id} : {:id => act.parent_id, :r => act.id, :anchor => "message-#{act.id}"}) %>
<%= textAreailizable act,:content %>
<%= l :label_activity_time %> :  <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
<% elsif e.forge_act_type == "News" %>
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <% unless act.nil? %> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id} %> <% end %>
<%= textAreailizable act,:description %>
<%= l :label_activity_time %> :  <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
<%= link_to l(:label_find_all_comments), {:controller => 'news', :action => 'show', :id => act.id} %> <%= l(:label_comments_count, :count => act.comments_count) %>
<% elsif e.forge_act_type == "Document" %>
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_document)}: #{act.title}"), {:controller => 'documents', :action => 'show', :id => act.id} %>
<%= textAreailizable act,:description %>
<%= l :label_activity_time %> :  <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
<% elsif e.forge_act_type == "Attachment" %>
<%= image_tag(url_to_avatar(e.user), :class => "avatar") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to(h(e.user), user_path(e.user_id)) %> <%= l(:label_new_activity) %> <%= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id} %>
<%= textAreailizable act,:description %>
<%= l :label_activity_time %> :  <%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>
<% end %> <% end %> <% end %>
<%= paginate @events_pages, :window => 3%>