Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/app/controllers/flows_controller.rb b/app/controllers/flows_controller.rb
- index a1bf97d..05d655b 100644
- --- a/app/controllers/flows_controller.rb
- +++ b/app/controllers/flows_controller.rb
- @@ -349,16 +349,29 @@ class FlowsController < BaseSpacesController
- @limit = params[:limit].to_i if params[:limit]
- @limit ||= 20
- + @page=params[:page].blank? ? 1 : params[:page]
- case flow_filter_view_type
- when 'priority'
- - @flow_items_pages, @flow_items = paginate :flows, :per_page => @limit, :order => 'priority ASC, flows.created_at DESC', :conditions => [ '(' + filter_sql + ") and space_id = ? and approved = ?", @space.id, true], :include => :user
- + @flow_items = Flow.paginate(:page=>@page, :per_page => @limit,
- + :order => 'priority ASC, flows.created_at DESC',
- + :conditions => [ '(' + filter_sql + ") and space_id = ? and approved = ?", @space.id, true],
- + :include => :user)
- when 'date'
- - @flow_items_pages, @flow_items = paginate :flows, :per_page => @limit, :order => 'flows.created_at DESC', :conditions => ['(' + filter_sql + ") and space_id = ? and approved = ?", @space.id, true], :include => :user
- + @flow_items = Flow.paginate(:page=>@page, :per_page => @limit,
- + :order => 'flows.created_at DESC',
- + :conditions => ['(' + filter_sql + ") and space_id = ? and approved = ?", @space.id, true],
- + :include => :user)
- when 'outline'
- - @flow_items_pages, @flow_items = paginate :flows, :per_page => @limit, :order => 'flows.thread_started_at DESC, lft', :conditions => ['(' + filter_sql + ") and space_id = ? and approved = ?", @space.id, true], :include => :user
- + @flow_items = Flow.paginate(:page=>@page, :per_page => @limit,
- + :order => 'flows.thread_started_at DESC, lft',
- + :conditions => ['(' + filter_sql + ") and space_id = ? and approved = ?", @space.id, true],
- + :include => :user)
- else # empty or threaded
- - @flow_items_pages, @flow_items = paginate :flows, :per_page => @limit, :order => 'flows.created_at DESC', :conditions => ['(' + filter_sql + ') and depth=0 and space_id=? and approved = 1', @space.id], :include => :user
- + @flow_items = Flow.paginate(:page=>@page,:per_page => @limit,
- + :order => 'flows.created_at DESC',
- + :conditions => ['(' + filter_sql + ') and depth=0 and space_id=? and approved = 1', @space.id],
- + :include => :user)
- end
- end
- diff --git a/app/views/flows/_list_items.rhtml b/app/views/flows/_list_items.rhtml
- index db5c8e6..be3aa92 100644
- --- a/app/views/flows/_list_items.rhtml
- +++ b/app/views/flows/_list_items.rhtml
- @@ -4,27 +4,15 @@
- <% if @flow_items.empty? %>
- <p class="note"><%= _("No items found.") %></p>
- <% else %>
- -
- <ul>
- <%= render :partial => "list_items_#{@flow_filter['viewtype'].downcase}" %>
- </ul>
- -
- - <% if @flow_items_pages.page_count > 1 -%>
- - <div class="page-list">Pages: <% pagination_links_each(@flow_items_pages, :link_to_current_page => true) do |n|
- - if(params[:page] == n.to_s || (params[:page].nil? && n == 1)) %>
- - <%= n %>
- - <% else %>
- - <% if @image_tool_comments%>
- - <%= link_to n, { :action => "index", :id => @space.id, :document_id => params[:document_id], :page => n }, :id => 'page_link_' + n.to_s %>
- - <% else %>
- - <%= link_to n, { :action => "flow", :id => @space.id, :page => n }, :id => 'page_link_' + n.to_s %>
- - <% end%>
- - <% end %>
- - <!-- end do -->
- - <% end %>
- - </div>
- -
- - <% end -%>
- +
- + <% if @image_tool_comments%>
- + <%=will_paginate @flow_items,:params=>{:action => "index", :id => @space.id, :document_id => params[:document_id]} %>
- + <% else %>
- + <%=will_paginate @flow_items,:params=>{:action => "flow", :id => @space.id} %>
- + <% end %>
- <% end %>
Add Comment
Please, Sign In to add comment