From 41fefd0b37c0f1291100ad499beeed27363938d5 Mon Sep 17 00:00:00 2001 From: yanxd Date: Tue, 14 Jan 2014 10:24:13 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8E=BB=E9=99=A4=E9=9A=90=E8=97=8F=E9=A1=B9?= =?UTF-8?q?=E7=9B=AE=E8=AF=BE=E7=A8=8B=E5=86=85=E7=9A=84=E5=86=85=E5=AE=B9?= =?UTF-8?q?=EF=BC=8C=20=E4=B8=8B=E8=BD=BD=E6=96=87=E4=BB=B6=E5=90=8D?= =?UTF-8?q?=E7=BC=A9=E7=95=A5=E6=98=BE=E7=A4=BA=E9=BC=A0=E6=A0=87=E7=A7=BB?= =?UTF-8?q?=E4=B8=8A=E5=8E=BB=E6=B5=AE=E5=8A=A8=E6=98=BE=E7=A4=BA=E6=89=80?= =?UTF-8?q?=E6=9C=89=20=E5=AE=8C=E6=95=B4=E6=96=87=E4=BB=B6=E5=90=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/stores_controller.rb | 4 ++-- app/views/stores/index.html.erb | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/stores_controller.rb b/app/controllers/stores_controller.rb index d8d7346d..b8e37bee 100644 --- a/app/controllers/stores_controller.rb +++ b/app/controllers/stores_controller.rb @@ -11,11 +11,11 @@ class StoresController < ApplicationController def index # @projects_attach = project_classification(0).take(LIMIT) # @courses_attach = project_classification(1).take(LIMIT) - @projects_attach = Attachment.includes(:project).where("projects.project_type=?", 0). + @projects_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 0, 1). reorder("#{Attachment.table_name}.downloads DESC"). limit(LIMIT) - @courses_attach = Attachment.includes(:project).where("projects.project_type=?", 1). + @courses_attach = Attachment.includes(:project).where("projects.project_type=? AND projects.is_public = ?", 1, 1). reorder("#{Attachment.table_name}.downloads DESC"). limit(LIMIT) @homeworks_attach = Attachment.where("container_type = 'HomeworkAttach'"). diff --git a/app/views/stores/index.html.erb b/app/views/stores/index.html.erb index ee7cda62..9ff68ec3 100644 --- a/app/views/stores/index.html.erb +++ b/app/views/stores/index.html.erb @@ -87,7 +87,7 @@ <% k.each do |c1|%> - <%= link_to c1.filename, (attachFromUrl c1) %> + <%= link_to c1.filename, (attachFromUrl c1), {:title => c1.filename} %> <%= c1.downloads %> <%= link_to_attachment c1, {:text => "下载"}%>