<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>vendor/plugins/will_paginate</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -4,3 +4,6 @@
 [submodule &quot;vendor/plugins/dataset&quot;]
 	path = vendor/plugins/dataset
 	url = git://github.com/jgarber/dataset.git
+[submodule &quot;vendor/plugins/will_paginate&quot;]
+	path = vendor/plugins/will_paginate
+	url = git://github.com/mislav/will_paginate.git</diff>
      <filename>.gitmodules</filename>
    </modified>
    <modified>
      <diff>@@ -3,7 +3,8 @@ class Admin::VersionsController &lt; ApplicationController
   before_filter :add_chronicle_stylesheet, :only =&gt; [:index, :show, :summary, :diff]
   
   def index
-    @versions = Version.find(:all, :order =&gt; &quot;created_at DESC&quot;)
+    per_page = Radiant::Config['chronicle.history.per_page']
+    @versions = Version.paginate(:page =&gt; params[:page], :order =&gt; 'created_at DESC', :per_page =&gt; per_page)
   end
 
   def show</diff>
      <filename>app/controllers/admin/versions_controller.rb</filename>
    </modified>
    <modified>
      <diff>@@ -20,3 +20,5 @@
             = link_to version.instance.title, polymorphic_path([:edit, :admin, version.instance])
         %td= version.instance.updated_by ? version.instance.updated_by.name : &quot;&quot;
         %td= version.created_at
+
+= will_paginate @versions
\ No newline at end of file</diff>
      <filename>app/views/admin/versions/index.html.haml</filename>
    </modified>
    <modified>
      <diff>@@ -12,6 +12,32 @@ describe Admin::VersionsController do
       get 'index'
       response.should be_success
     end
+    
+    it &quot;should have some versions&quot; do
+      get 'index'
+      assigns['versions'].should_not be_nil
+    end
+    
+    describe &quot;pagination&quot; do
+      before do
+        @page = pages(:published)
+        100.times do |i|
+          @page.title = i
+          @page.save
+        end
+      end
+      
+      it &quot;should paginate&quot; do
+        get 'index'
+        assigns['versions'].size.should == 30
+      end
+
+      it &quot;should paginate according to config&quot; do
+        Radiant::Config['chronicle.history.per_page'] = 50
+        get 'index'
+        assigns['versions'].size.should == 50
+      end
+    end
   end
 
   describe &quot;GET 'show'&quot; do</diff>
      <filename>spec/controllers/admin/versions_controller_spec.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>8352ec68390f9ea9593574d3ef285966760a9ec9</id>
    </parent>
  </parents>
  <author>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </author>
  <url>http://github.com/jgarber/radiant-chronicle-extension/commit/e10336f9bd47985e476a4237de2518cd7865dd52</url>
  <id>e10336f9bd47985e476a4237de2518cd7865dd52</id>
  <committed-date>2009-08-07T11:51:51-07:00</committed-date>
  <authored-date>2009-08-07T11:51:51-07:00</authored-date>
  <message>Paginate the history page.  Closes #20.</message>
  <tree>cc5afec273b40cb4769c59b54f2157fb3abd054e</tree>
  <committer>
    <name>Jason Garber</name>
    <email>jg@jasongarber.com</email>
  </committer>
</commit>
