Changeset 291

Show
Ignore:
Timestamp:
04/28/08 11:07:38 (7 months ago)
Author:
eric.dumin..@gmail.com
Message:

Links are "a bit less" broken.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/log_indexing_time_with_ferret/lib/picolena/templates/app/controllers/documents_controller.rb

    r283 r291  
    2323    start=Time.now 
    2424      @query=[params[:id],params.delete(:format)].compact.join('.') 
    25       sort=params[:sort] 
     25      @sort=params[:sort] 
    2626      page=params[:page]||1 
    27       finder=Finder.new(@query,sort,page) 
     27      finder=Finder.new(@query,@sort,page) 
    2828      finder.execute! 
    2929      pager=::Paginator.new(finder.total_hits, Picolena::ResultsPerPage) do 
  • branches/log_indexing_time_with_ferret/lib/picolena/templates/app/helpers/documents_helper.rb

    r283 r291  
    77  # Very basic pagination. 
    88  # Provides liks to Next, Prev and FirstPage when needed. 
    9   def should_paginate(page,query
    10     [(link_to("←←", :action => :show, :id => query, :page => 1) if page.number>2), 
    11      (link_to("←", :action => :show, :id => query, :page => page.prev.number) if page.prev?), 
    12      (link_to("→", :action => :show, :id => query, :page => page.next.number) if page.next?)].compact.join(" | ") 
     9  def should_paginate(page,query, sort
     10    [(link_to("←←", :action => :show, :id => query, :sort=>sort) if page.number>2), 
     11     (link_to("←", :action => :show, :id => query, :page => page.prev.number, :sort=>sort) if page.prev?), 
     12     (link_to("→", :action => :show, :id => query, :page => page.next.number, :sort=>sort) if page.next?)].compact.join(" | ") 
    1313  end 
    1414   
  • branches/log_indexing_time_with_ferret/lib/picolena/templates/app/views/documents/show.html.haml

    r283 r291  
    88        =show_time_needed(@time_needed) 
    99      -else 
    10         %span{:class=>'pagination'}=should_paginate(@matching_documents, @query
     10        %span{:class=>'pagination'}=should_paginate(@matching_documents, @query, @sort
    1111        =describe_results(@matching_documents, @total_hits, @time_needed, h(@query)) 
    1212-unless nothing_found?