<%= javascript_include_tag "jquery.infinitescroll.js" %>

<%= l(:label_activity) %>

<% unless @events_pages.empty? %> <% @events_pages.each do |e| -%> <% if e.forge_act_type == "ProjectCreateInfo"%>
<%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %>
<%= link_to e.user, user_path(e.user), :class => "problem_name c_orange fl" %> <%= l(:label_project_create) %> : <%= link_to e.project.name,{} ,:class => "problem_tit fl fb" %>


<%= l :label_create_time %> :<%= format_time(e.project.created_on) %>

<% 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), :width => "42", :height => "42") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to act.author, user_path(act.author), :class => "problem_name c_orange fl" %> <%= 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}, :class => "problem_tit fl fb " %>

<%= textAreailizable act,:description %>
<%= l :label_activity_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>

<% elsif e.forge_act_type == "Journal" %>
<%= image_tag(url_to_avatar(e.user), :width => "42", :height => "42") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : <%= 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}"}, :class => "problem_tit fl fb" %>

<%= textilizable 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), :width => "42", :height => "42") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : <%= link_to format_activity_title("#{act.board.name}: #{act.subject}"), project_boards_path(@project,:topic_id => act.id), :class => "problem_tit fl fb " %>

<%= textAreailizable act,:content %>

<%= l :label_create_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), :width => "42", :height => "42") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : <% unless act.nil? %> <%= link_to format_activity_title("#{l(:label_news)}: #{act.title}"), {:controller => 'news', :action => 'show', :id => act.id}, :class => "problem_tit fl fb " %> <% end %>

<%= textAreailizable act,:description %>
<%= l :label_create_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), :width => "42", :height => "42") %>
<%= h(e.project) if @project.nil? || @project.id != e.project_id %> <%= link_to h(e.user), user_path(e.user_id), :class => "problem_name c_orange fl" %> <%= l(:label_new_activity) %> : <%= link_to format_activity_title("#{l(:label_attachment)}: #{act.filename}"), {:controller => 'attachments', :action => 'show', :id => act.id}, :class => "problem_tit fl fb" %>

<%= textAreailizable act,:description %>
<%= l :label_create_time %> :<%= format_activity_day(act.created_on) %> <%= format_time(act.created_on, false) %>

<% end %> <% end %> <% end %> <%= paginate @events_pages, :left => 3, :right => 3 %>