diff options
author | francis <francis> | 2008-03-05 22:55:25 +0000 |
---|---|---|
committer | francis <francis> | 2008-03-05 22:55:25 +0000 |
commit | 91190cda0bca095412600d17d3d1225a48096397 (patch) | |
tree | 3a379168ff036a6d18265ed68ae946534a91d72a | |
parent | ea493de6fe8ce5dd368c5a0fd3be31cea155c1af (diff) |
Nasty hack for pagination on admin pages on proxy.
-rw-r--r-- | vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb b/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb index b3702fc09..a1ce1c453 100644 --- a/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb +++ b/vendor/plugins/will_paginate/lib/will_paginate/view_helpers.rb @@ -115,7 +115,12 @@ module WillPaginate @template.content_tag :span, text, :class => span_class else # page links should preserve GET/POST parameters - @template.link_to text, @template.params.merge(param => page != 1 ? page : nil) + if @template.params[:controller].match(/^admin_/) + # XXX hack for admin pages, for mySociety HTTP proxy, use relative URL + @template.link_to text, "?page=" + page.to_s + else + @template.link_to text, @template.params.merge(param => page != 1 ? page : nil) + end end end |