项目资源提供新分页

This commit is contained in:
huang 2016-01-08 20:10:43 +08:00
parent 580e4d7327
commit 64889fd14a
3 changed files with 14 additions and 4 deletions

View File

@ -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|

View File

@ -123,7 +123,7 @@
<div class="cl"></div>
</div>
<div id="course_list">
<%= 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} %>
</div>
</div>
<% html_title(l(:label_attachment_plural)) -%>

View File

@ -45,8 +45,17 @@
<% end %>
<% end %>
<ul class="wlist">
<%= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>
</ul>
<% if project_attachments.count == 10%>
<% if params[:action] == 'search_project' %>
<!--<ul class="wlist">-->
<!--<%#= pagination_links_full @obj_pages, @obj_count, :per_page_links => false, :remote => @is_remote, :flag => true%>-->
<!--</ul>-->
<%=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%>
<!-- 全站搜索的时候 返回的页码对象是obj_pages,而站内搜索返回的页码对象是feedback_pages -->
<%=link_to "点击展开更多", project_files_path(:project_id => project.id,:page => @page),:id => "show_more_attachments",:remote => "true",:class => "loadMore mt10 f_grey" %>
<%end%>
<% end%>