Retrospectiva の変更群一覧ページを AutoPagerize 対応にするパッチ


Retrospectiva の変更群一覧ページ (/changesets) を AutoPagerize 対応にするパッチを書きました。

変更群がビャーっと伸びていくのでとても使いやすくなります。本当はチケット一覧のほうも対応したいけれど、Javascriptが絡んでいて面倒そうなのでとりあえずパスです・・・。

(2008/04/08追記) チケット一覧も一応できました: dara日記

Index: app/helpers/application_helper.rb
===================================================================
--- app/helpers/application_helper.rb	(revision 495)
+++ app/helpers/application_helper.rb	(working copy)
@@ -167,7 +167,7 @@
       prev_link = link_to(prev_link, :overwrite_params => {:page => page})
     end
     if page = paginator.current.next
-      next_link = link_to(next_link, :overwrite_params => {:page => page})
+      next_link = link_to(next_link, {:overwrite_params => {:page => page}}, {:rel => 'next'})
     end
     page_links = pagination_links_each(paginator, options) do |n|
       link_to(n.to_s, { :overwrite_params => {:page => n} })
Index: app/views/changesets/changesets.rhtml
===================================================================
--- app/views/changesets/changesets.rhtml	(revision 495)
+++ app/views/changesets/changesets.rhtml	(working copy)
@@ -5,12 +5,12 @@

<% @changesets.each_with_index do |changeset, index| -%>

- <h2 class=“bottom-5”> + <h2 class=“bottom-5 autopagerize_page_element”> <%= link_to(_(‘Changeset’) + ’ ’ + changeset.revision.to_s, :action => ‘changeset’, :revision => changeset.revision) -%> </h2>

- <div class=“bottom-15”> + <div class=“bottom-15 autopagerize_page_element”> <p class=“strong bottom-5”> <%= datetime_format(changeset.revised_at) -%> (<%= time_interval_in_words(changeset.revised_at) -%>) <% unless changeset.author.blank? -%> @@ -26,7 +26,7 @@

<% if @pages.page_count > 1 -%> - <div class=“content-footer”><%= nice_pagination_links(@pages) -%></div> + <div class=“content-footer autopagerize_insert_before”><%= nice_pagination_links(@pages) -%></div> <% end -%>

</div>