<% project = Project.find(activity.project_id) %>
<% user = get_user_by_mail(activity.committer) %>
<div class="resources mt10">
  <div class="homepagePostBrief">
    <div class="homepagePostPortrait">
      <%= link_to image_tag(url_to_avatar(user), :width => "50", :height => "50"), user_path(user), :alt => "用户头像" %>
      <%= render :partial => 'users/show_detail_info', :locals => {:user => user} %>
    </div>
    <div class="homepagePostDes">
      <div class="homepagePostTo break_word">
        <% if user.try(:realname) == ' ' %>
            <%= link_to user, user_path(user), :class => "newsBlue mr15" %>
        <% else %>
            <%= link_to user.try(:realname), user_path(user), :class => "newsBlue mr15" %>
        <% end %>
        TO
        <%= link_to project.to_s+" | 项目代码提交", project_path(project.id,:host=>Setting.host_course), :class => "newsBlue ml15" %>
      </div>
      <div class="homepagePostTitle break_word" >
        <%= link_to activity.comments, {:controller => 'repositories', :action => 'commit_diff', :id => project.id, :repository_id => identifier, :changeset => activity.version}, :class => "postGrey" %>
      </div>
      <div class="homepagePostDate">
        提交时间：<%= format_time(activity.committed_on) %>
      </div>
    </div>
    <div class="cl"></div>
  </div>
</div>
