From e788cd9a0f964a3770c6abfa79419c06231ffe2f Mon Sep 17 00:00:00 2001 From: z9hang Date: Tue, 2 Dec 2014 17:06:17 +0800 Subject: [PATCH 1/8] =?UTF-8?q?=20#1149=20=E8=B5=84=E6=BA=90=E6=90=9C?= =?UTF-8?q?=E7=B4=A2=EF=BC=9A=E5=B9=B3=E5=8F=B0=E6=8F=90=E7=A4=BA=E8=AF=B4?= =?UTF-8?q?=E4=B8=8D=E4=BC=9A=E6=90=9C=E7=B4=A2=E7=A7=81=E6=9C=89=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E4=B8=AD=E7=9A=84=E5=86=85=E5=AE=B9=EF=BC=8C=E5=AE=9E?= =?UTF-8?q?=E9=99=85=E4=B8=8A=E5=8D=B4=E5=8F=AF=E6=90=9C=E7=B4=A2=E5=BE=97?= =?UTF-8?q?=E5=88=B0=E7=A7=81=E6=9C=89=E9=A1=B9=E7=9B=AE=E4=B8=AD=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/stores_controller.rb | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/app/controllers/stores_controller.rb b/app/controllers/stores_controller.rb index a68d12517..b1705c826 100644 --- a/app/controllers/stores_controller.rb +++ b/app/controllers/stores_controller.rb @@ -26,19 +26,19 @@ class StoresController < ApplicationController resultSet = Attachment.where("attachments.container_type IS NOT NULL AND filename LIKE :like ", like: "%#{keywords}%"). reorder("created_on DESC") - # result = resultSet.to_a.dup + result = resultSet.to_a.dup - # resultSet.to_a.map { |res| - # if(res.container.nil? || - # (res.container.class.to_s=="Project" && res.container.is_public == false) || - # (res.container.has_attribute?(:project) && res.container.project.is_public == false) || - # (res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) || - # false - # ) - # result.delete(res) - # end - # } - # result + resultSet.to_a.map { |res| + if(res.container.nil? || + (res.container.class.to_s=="Project" && res.container.is_public == false) || + (res.container.has_attribute?(:project) && res.container.project.is_public == false) || + (res.container.class.to_s=="HomeworkAttach" && res.container.bid.reward_type == 3) || + false + ) || (res.container.is_a?(Course) && res.container.is_public == 0) + result.delete(res) + end + } + result end LIMIT = 12 unless const_defined?(:LIMIT) From ebed04c7bf2adf902ef107c72adf3d57caa6b233 Mon Sep 17 00:00:00 2001 From: zhuhao Date: Wed, 3 Dec 2014 11:05:52 +0800 Subject: [PATCH 2/8] =?UTF-8?q?=E5=88=9B=E5=AE=A2=E7=A9=BA=E9=97=B4?= =?UTF-8?q?=E5=B7=A6=E4=BE=A7=E5=85=AC=E5=85=B1=E9=A1=B5=E8=A2=AB=E6=8B=89?= =?UTF-8?q?=E4=BC=B8=E5=AF=BC=E8=87=B4=E5=87=BA=E7=8E=B0=E6=BB=9A=E5=8A=A8?= =?UTF-8?q?=E6=9D=A1=E7=9A=84=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/layouts/base_users.html.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/views/layouts/base_users.html.erb b/app/views/layouts/base_users.html.erb index ba84abc68..5276bcd01 100644 --- a/app/views/layouts/base_users.html.erb +++ b/app/views/layouts/base_users.html.erb @@ -189,7 +189,7 @@