资源申请添加链接

This commit is contained in:
huang 2016-05-19 16:53:22 +08:00
parent 984f706722
commit 1402f2076a
2 changed files with 25 additions and 3 deletions

View File

@ -9,9 +9,18 @@
</li>
<li class="<%=(ma.apply_result == 0 || ma.apply_result.nil?) ? 'homepageHomeworkContent2' : 'homepageHomeworkContent' %> fl">
<% content = ma.course_message.content.nil? ? '' : ''+ ma.course_message.content.to_s %>
<a title="<%= ma.course_message.user.show_name + "申请引用资源\""+"#{ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)}"+"\"#{content}" %>" class = "<%= ma.viewed == 0 ? "newsBlack" : "newsGrey "%>">
<%= ma.course_message.user.show_name + "申请引用资源\""+"#{ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)}"+"\"#{content}" %>
</a>
<% show_content = ma.course_message.user.show_name + "申请引用资源\""+"#{ma.course_message.find_attachment(ma.course_message.attachment_id).try(:filename)}"+"\"#{content}" %>
<% if ma.course_message.container_type == "Course" %>
<%= link_to show_content, course_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
<% elsif ma.course_message.container_type == "Project" %>
<%= link_to show_content, project_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
<% elsif ma.course_message.container_type == "OrgSubfield" %>
<%= link_to show_content, org_subfield_files_path(ma.course_message.container_id), :title => show_content, :class => " #{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>
<% else %>
<a title="<%= show_content %>" class = "<%= ma.viewed == 0 ? "newsBlack" : "newsGrey "%>">
<%= show_content %>
</a>
<% end %>
</li>
<li class="<%=(ma.apply_result == 0 || ma.apply_result.nil?) ? 'homepageHomeworkContentWarn2' : 'homepageHomeworkContentWarn' %> fl">

View File

@ -14,6 +14,19 @@
'您申请引用资源"'+ 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>