From d0c2eabddd127952088d28d195061a22a79d6cda Mon Sep 17 00:00:00 2001 From: ouyangxuhua Date: Tue, 19 Jan 2016 16:42:10 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E6=9C=AA=E7=99=BB=E9=99=86=E6=83=85?= =?UTF-8?q?=E5=86=B5=E4=B8=8B=EF=BC=8C=E4=B9=9F=E8=83=BD=E4=B8=8B=E8=BD=BD?= =?UTF-8?q?=E7=BB=84=E7=BB=87=E4=B8=8B=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- app/helpers/application_helper.rb | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index fd43977ee..514f68d49 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -600,7 +600,7 @@ private def has_login unless @attachment && @attachment.container_type == "PhoneAppVersion" - render_403 unless User.current.logged? + render_403 if !User.current.logged? && @attachment.container_type != 'OrgSubfield' && @attachment.container_type != 'OrgDocumentComment' end end end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 07f7a0ed8..9f08a63ed 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -1996,6 +1996,8 @@ module ApplicationHelper candown= User.current.member_of_course?(course) || (course.is_public==1 && attachment.is_public == 1) elsif attachment.container.is_a?(OrgSubfield) candown = true + elsif attachment.container.is_a?(OrgDocumentComment) + candown = true elsif (attachment.container.has_attribute?(:board) || attachment.container.has_attribute?(:board_id)) && attachment.container.board && attachment.container.board.course course = attachment.container.board.course From 6e56a0706a9c9444a95607a4907c07aa93899399 Mon Sep 17 00:00:00 2001 From: cxt Date: Tue, 19 Jan 2016 16:53:34 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E5=8A=A8=E6=80=81=E6=8F=8F=E8=BF=B0?= =?UTF-8?q?=E4=B8=AD=E7=9A=84=E5=8D=95=E8=AF=8D=E6=8A=98=E8=A1=8C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/blogs/_article.html.erb | 16 +++++++--------- app/views/blogs/_homepage.html.erb | 5 ++--- app/views/org_document_comments/show.html.erb | 7 ++++++- .../organizations/_org_course_homework.html.erb | 7 ++----- .../organizations/_org_course_message.html.erb | 16 +++++++--------- .../organizations/_org_course_news.html.erb | 6 +----- .../organizations/_org_course_poll.html.erb | 7 ++----- .../organizations/_org_project_issue.html.erb | 8 +------- .../organizations/_org_subfield_message.html.erb | 15 ++++++--------- .../organizations/_project_message.html.erb | 15 ++++++--------- app/views/organizations/_show_home_page.html.erb | 5 ++++- .../organizations/_show_org_document.html.erb | 5 ++++- app/views/projects/_project_news.html.erb | 6 +----- app/views/users/_course_homework.html.erb | 7 ++----- app/views/users/_course_message.html.erb | 15 ++++++--------- app/views/users/_course_news.html.erb | 6 +----- app/views/users/_course_poll.html.erb | 6 +----- app/views/users/_intro_content.html.erb | 12 ++++++++++++ app/views/users/_project_issue.html.erb | 8 +------- app/views/users/_project_message.html.erb | 15 ++++++--------- app/views/users/_user_blog.html.erb | 6 +----- app/views/users/_user_homework_detail.html.erb | 6 +----- app/views/users/user_system_messages.html.erb | 2 +- public/stylesheets/courses.css | 2 +- public/stylesheets/new_user.css | 4 ++-- public/stylesheets/project.css | 2 +- 26 files changed, 85 insertions(+), 124 deletions(-) create mode 100644 app/views/users/_intro_content.html.erb diff --git a/app/views/blogs/_article.html.erb b/app/views/blogs/_article.html.erb index 22df4499a..4e0270da2 100644 --- a/app/views/blogs/_article.html.erb +++ b/app/views/blogs/_article.html.erb @@ -81,15 +81,13 @@ 更新时间:<%= format_time(UserActivity.where("act_type='#{activity.class}' and act_id =#{activity.id}").first.updated_at) %>
-
-
- <% if activity.parent_id.nil? %> - <%= activity.content.to_s.html_safe%> - <% else %> - <%= activity.parent.content.to_s.html_safe%> - <% end %> -
-
+ <% if activity.parent_id.nil? %> + <% content= activity.content%> + <% else %> + <% content= activity.parent.content%> + <% end %> + <%=render :partial =>"users/intro_content", :locals=>{:user_activity_id =>user_activity_id, :content=>content} %> +