<ul class="homepageNewsList fl">
  <li class="homepageNewsPortrait fl">
    <% owner = User.find(ma.course_message.apply_user_id) %>
    <div class="navHomepageLogo fl">
      <%= link_to image_tag(url_to_avatar(owner), :width => "30", :height => "30", class: "mt3"), user_path(owner) %>
    </div>
  </li>
  <li class="homepageNewsPubType fl">
    <%= link_to owner.show_name, user_path(owner), :class => "newsBlue homepageNewsPublisher" %>
    <span class="<%= ma.viewed == 0 ? "homepageNewsTypeNotRead fl":"homepageNewsType fl" %>"><%= ma.apply_result == 2 ? '同意' : '拒绝'%>引用资源：</span>
  </li>
  <li class="homepageNewsContent fl"><a href="javascript:void(0);" class="newsGrey">
    <% link_str = ma.apply_result == 2 ?
            '您申请引用资源"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"的申请已通过'
    :
            '您申请引用资源"'+ ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename) + '"的申请被婉拒' %>
    <% if ma.course_message.container_type == "Course" %>
        <%= link_to link_str, course_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
    <% elsif ma.course_message.container_type == "Project" %>
        <%= link_to link_str, project_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
    <% elsif ma.course_message.container_type == "OrgSubfield" %>
        <%= link_to link_str, org_subfield_files_path(ma.course_message.container_id), :title => link_str, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
    <% else %>
        <a title="<%= link_str %>" class = "<%= ma.viewed == 0 ? "newsBlack" : "newsGrey "%>">
          <%= link_str %>
        </a>
    <% end %>


    <%= link_to link_str, user_resource_user_path(User.current, :type => 2), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
  </a>
  </li>
  <li class="homepageNewsTime fl"><%= time_tag(ma.created_at).html_safe %> </li>
</ul>