<%# first_pro = sort_projects.first %>
<% first_pro = Project.find sort_projects.first.project_id %>
<% commit_time = first_pro.project_score.commit_time %>
<% one_forge_time=ForgeActivity.where("project_id=?",first_pro.id).last.updated_at if ForgeActivity.where("project_id=?",first_pro.id).last %>
# <%=time_from_now !commit_time.nil? && format_time(commit_time) > format_time(one_forge_time) ? commit_time : one_forge_time %><%= link_to User.find(first_pro.user_id).show_name, user_activities_path(first_pro.user_id), :class => "newsBlue ml5 mr5"%>更新了项目,最近更新:
<% sort_projects.each_with_index do |pro, i| %>
<% project = Project.find pro.project_id %>
<% com_time = project.project_score.commit_time %>
<% forge_time=ForgeActivity.where("project_id=?",project.id).last.updated_at if ForgeActivity.where("project_id=?",project.id).last %>
<% if project.is_public || User.current.member_of?(project) || User.current.admin? %>
<%= link_to image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage"),project_path(project.id,:host=>Setting.host_name),:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像", :target => '_blank' %>
<%=link_to (User.find project.user_id).show_name+"(组长)", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{(User.find project.user_id).show_name}(组长)" %>
<% update_time = time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
<%=link_to update_time+" "+project.project_score.changeset_num.to_s+"提交", project_path(project.id,:host=>Setting.host_name), :target => '_blank', :title => "#{update_time} #{project.project_score.changeset_num.to_s}提交" %>
<% else %>
<%= image_tag(url_to_avatar(project),:width=>"40",:height => "40",:class => "borderRadius relatePImage",:id=>"project_img_"+project.id.to_s+"_"+activity.id.to_s,:alt =>"项目头像",:title => "私有项目不可访问") %>
<%=(User.find project.user_id).show_name %>(组长)
<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %> <%= project.project_score.changeset_num %>提交
<% end %>
项目名称:<%=project.name %>
创建者:<%=(User.find project.user_id).show_name %>(组长)
更新时间:<%=time_from_now !com_time.nil? && format_time(com_time) > format_time(forge_time) ? com_time : forge_time %>
<% end %>
<% if i > 9 && i == (projects.count - 1) %>