From a6698bf2f1d9f6457355804858b554a8bc349657 Mon Sep 17 00:00:00 2001 From: alan <547533434@qq.com> Date: Tue, 28 Oct 2014 23:48:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9bug=E3=80=8A=E9=80=89?= =?UTF-8?q?=E5=AE=9A=E4=BA=86=E5=86=85=E5=AE=B9=E7=B1=BB=E5=9E=8B=E5=90=8E?= =?UTF-8?q?=E5=86=8D=E7=82=B9=E5=87=BB=E8=A1=A8=E5=A4=B4=E8=BF=9B=E8=A1=8C?= =?UTF-8?q?=E6=8E=92=E5=BA=8F=E6=80=BB=E6=98=AF=E8=BF=94=E5=9B=9E=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E7=A9=BA=E7=99=BD=E9=A1=B5=E3=80=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: alan <547533434@qq.com> --- app/controllers/files_controller.rb | 32 ++++++++++++++++------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index 3d1970656..9171407eb 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -16,7 +16,11 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class FilesController < ApplicationController - layout 'base_projects'#by young + if @project + layout 'base_projects' #by young + else + layout 'base_courses' + end menu_item :files before_filter :find_project_by_project_id#, :except => [:getattachtype] @@ -300,25 +304,25 @@ class FilesController < ApplicationController @containers = [ Project.includes(:attachments).reorder("#{Attachment.table_name}.created_on DESC").find(@project.id)] @containers += @project.versions.includes(:attachments).reorder(sort).all - show_attachments @containers - @attachtype = params[:type].to_i - @contenttype = params[:contentType].to_s - render :layout => 'base_projects' + + #render :layout => 'base_projects' elsif @course @isproject = false @containers = [ Course.includes(:attachments).reorder(sort).find(@course.id)] - show_attachments @containers - @attachtype = params[:type].to_i - @contenttype = params[:contentType].to_s - render :layout => 'base_courses' + # show_attachments @containers + # @attachtype = params[:type].to_i + # @contenttype = params[:contentType].to_s + end + show_attachments @containers + @attachtype = params[:type].to_i + @contenttype = params[:contentType].to_s - - # respond_to do |format| - # format.js - # format.html - # end + respond_to do |format| + format.js + format.html + end end end