From 64889fd14a9d548fa5bdc6ef28038d27faa89467 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 8 Jan 2016 20:10:43 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A1=B9=E7=9B=AE=E8=B5=84=E6=BA=90=E6=8F=90?= =?UTF-8?q?=E4=BE=9B=E6=96=B0=E5=88=86=E9=A1=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/files_controller.rb | 1 + app/views/files/_course_file.html.erb | 2 +- app/views/files/_project_list.html.erb | 15 ++++++++++++--- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/app/controllers/files_controller.rb b/app/controllers/files_controller.rb index c6773ef57..06ea15357 100644 --- a/app/controllers/files_controller.rb +++ b/app/controllers/files_controller.rb @@ -230,6 +230,7 @@ class FilesController < ApplicationController @order = "" @is_remote = false if params[:project_id] + @page = params[:page] ? params[:page].to_i + 1 : 2 @container_type = 0 if params[:sort] params[:sort].split(",").each do |sort_type| diff --git a/app/views/files/_course_file.html.erb b/app/views/files/_course_file.html.erb index 5a6ce69ce..9513baab0 100644 --- a/app/views/files/_course_file.html.erb +++ b/app/views/files/_course_file.html.erb @@ -123,7 +123,7 @@
- <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments, :page=>2} %> + <%= render :partial => 'course_list',:locals => {course: @course,all_attachments: @all_attachments,sort:@sort,order:@order,curse_attachments:@obj_attachments} %>
<% html_title(l(:label_attachment_plural)) -%> \ No newline at end of file diff --git a/app/views/files/_project_list.html.erb b/app/views/files/_project_list.html.erb index d84c1cada..0d4b0f35e 100644 --- a/app/views/files/_project_list.html.erb +++ b/app/views/files/_project_list.html.erb @@ -45,8 +45,17 @@ <% end %> <% end %> - +<% if project_attachments.count == 10%> + <% if params[:action] == 'search_project' %> + + + + <%=link_to "点击展开更多", search_project_project_files_path({:project_id => project.id, :page => @obj_pages.nil? ? @feedback_pages.page + 1 : @obj_pages.page + 1}.merge(params)),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> + <%else%> + + <%=link_to "点击展开更多", project_files_path(:project_id => project.id,:page => @page),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %> + <%end%> +<% end%> +