From 1402f2076a91b49bd5c71abce7072159cf0ff5d2 Mon Sep 17 00:00:00 2001 From: huang Date: Thu, 19 May 2016 16:53:22 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=84=E6=BA=90=E7=94=B3=E8=AF=B7=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/_apply_resource_course_message.html.erb | 15 ++++++++++++--- .../_apply_resource_course_message_reply.html.erb | 13 +++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/app/views/users/_apply_resource_course_message.html.erb b/app/views/users/_apply_resource_course_message.html.erb index 4dbec8127..fd493daf2 100644 --- a/app/views/users/_apply_resource_course_message.html.erb +++ b/app/views/users/_apply_resource_course_message.html.erb @@ -9,9 +9,18 @@
  • <% content = ma.course_message.content.nil? ? '' : ':'+ ma.course_message.content.to_s %> - " 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}" %> - + <% 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 %> + "> + <%= show_content %> + + <% end %>
  • diff --git a/app/views/users/_apply_resource_course_message_reply.html.erb b/app/views/users/_apply_resource_course_message_reply.html.erb index 7cf246c53..617ee53c3 100644 --- a/app/views/users/_apply_resource_course_message_reply.html.erb +++ b/app/views/users/_apply_resource_course_message_reply.html.erb @@ -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 %> + "> + <%= link_str %> + + <% end %> + + <%= link_to link_str, user_resource_user_path(User.current, :type => 2), :title => link_str,:class => "#{ma.viewed == 0 ? "newsBlack" : "newsGrey "}" %>