aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/willpaginate_hack.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/willpaginate_hack.rb b/lib/willpaginate_hack.rb
new file mode 100644
index 000000000..084329e82
--- /dev/null
+++ b/lib/willpaginate_hack.rb
@@ -0,0 +1,14 @@
+# Monkeypatch! Hack for admin pages, when proxied via https on mySociety servers, they
+# need a relative URL.
+module WillPaginate
+ class LinkRenderer
+ def page_link(page, text, attributes = {})
+ url = url_for(page)
+ if url.match(/^\/admin.*(\?.*)/)
+ url = $1
+ end
+ @template.link_to text, url, attributes
+ end
+ end
+end
+