Permalink
Browse files

Welcome back will_paginate.

  • Loading branch information...
1 parent ff53757 commit 6828e719e9bcc55678aeff24a5aab91be0c5e4a8 @ugisozols ugisozols committed Aug 24, 2011
Showing with 135 additions and 184 deletions.
  1. +7 −8 Gemfile.lock
  2. +1 −1 authentication/app/views/refinery/admin/users/_users.html.erb
  3. +0 −1 changelog.md
  4. +1 −1 core/app/assets/javascripts/refinery/admin.js
  5. +0 −11 core/app/views/kaminari/_next_page.html.erb
  6. +0 −21 core/app/views/kaminari/_paginator.html.erb
  7. +0 −12 core/app/views/kaminari/_prev_page.html.erb
  8. +0 −10 core/config/initializers/kaminari_monkeypatches.rb
  9. +18 −0 core/config/initializers/will_paginate_monkeypatch.rb
  10. +3 −3 core/config/locales/bg.yml
  11. +3 −3 core/config/locales/cs.yml
  12. +3 −3 core/config/locales/da.yml
  13. +3 −3 core/config/locales/de.yml
  14. +3 −3 core/config/locales/el.yml
  15. +3 −3 core/config/locales/en.yml
  16. +3 −3 core/config/locales/es.yml
  17. +3 −0 core/config/locales/fi.yml
  18. +3 −3 core/config/locales/fr.yml
  19. +3 −3 core/config/locales/it.yml
  20. +3 −3 core/config/locales/jp.yml
  21. +3 −3 core/config/locales/ko.yml
  22. +3 −3 core/config/locales/lolcat.yml
  23. +3 −3 core/config/locales/lt.yml
  24. +3 −3 core/config/locales/lv.yml
  25. +3 −3 core/config/locales/nb.yml
  26. +3 −3 core/config/locales/nl.yml
  27. +3 −3 core/config/locales/pl.yml
  28. +3 −3 core/config/locales/pt-BR.yml
  29. +3 −3 core/config/locales/rs.yml
  30. +3 −3 core/config/locales/ru.yml
  31. +3 −3 core/config/locales/sk.yml
  32. +3 −3 core/config/locales/sl.yml
  33. +3 −3 core/config/locales/sv.yml
  34. +3 −3 core/config/locales/vi.yml
  35. +3 −3 core/config/locales/zh-CN.yml
  36. +3 −3 core/config/locales/zh-TW.yml
  37. +1 −1 core/lib/gemspec.rb
  38. +1 −1 core/lib/refinery/crud.rb
  39. +1 −1 core/lib/refinerycms-core.rb
  40. +3 −7 core/refinerycms-core.gemspec
  41. +1 −1 ...b/generators/refinery/engine/templates/app/views/refinery/admin/plural_name/_plural_name.html.erb
  42. +1 −1 images/app/controllers/refinery/admin/images_controller.rb
  43. +1 −1 images/app/views/refinery/admin/images/_existing_image.html.erb
  44. +1 −1 images/app/views/refinery/admin/images/_images.html.erb
  45. +5 −7 pages/app/controllers/refinery/admin/pages_dialogs_controller.rb
  46. +5 −5 pages/app/views/refinery/admin/pages_dialogs/link_to.html.erb
  47. +3 −5 resources/app/controllers/refinery/admin/resources_controller.rb
  48. +1 −1 resources/app/views/refinery/admin/resources/_existing_resource.html.erb
  49. +1 −1 resources/app/views/refinery/admin/resources/_resources.html.erb
  50. +1 −7 settings/app/models/refinery/setting.rb
  51. +1 −1 settings/app/views/refinery/admin/settings/_settings.html.erb
View
@@ -1,13 +1,13 @@
GIT
remote: git://github.com/collectiveidea/awesome_nested_set.git
- revision: 75cfe9015f69bf2cc4953a9215da118f18148997
+ revision: 3f19d9ae9f02877dce3342f91d9be36dc3b7ab2f
specs:
awesome_nested_set (2.0.1)
activerecord (>= 3.0.0)
GIT
remote: git://github.com/parndt/refinerycms-i18n
- revision: fd9cefe199f05005354ae0838763660cee968493
+ revision: 7548b3be85baba5edc5a57429db05740afce8062
specs:
refinerycms-i18n (2.0.0)
refinerycms-core (~> 2.0.0)
@@ -31,7 +31,7 @@ GIT
rack-cache (~> 1.0.2)
rack-mount (~> 0.8.1)
rack-test (~> 0.6.0)
- sprockets (~> 2.0.0.beta.12)
+ sprockets (~> 2.0.0.beta.14)
activemodel (3.1.0.rc6)
activesupport (= 3.1.0.rc6)
bcrypt-ruby (~> 2.1.4)
@@ -88,14 +88,14 @@ PATH
friendly_id_globalize3 (~> 3.2.1)
globalize3 (~> 0.2.0.beta3)
jquery-rails
- kaminari (~> 0.12)
rails (>= 3.1.0.rc6)
refinerycms-base (= 2.0.0)
refinerycms-generators (= 2.0.0)
refinerycms-settings (= 2.0.0)
sass-rails (>= 3.1.0.rc.6)
truncate_html (~> 0.5)
uglifier
+ will_paginate (~> 3.0)
refinerycms-dashboard (2.0.0)
refinerycms-core (= 2.0.0)
refinerycms-generators (2.0.0)
@@ -191,8 +191,6 @@ GEM
railties (~> 3.0)
thor (~> 0.14)
json_pure (1.5.3)
- kaminari (0.12.4)
- rails (>= 3.0.0)
launchy (2.0.5)
addressable (~> 2.2.6)
mail (2.3.0)
@@ -219,7 +217,7 @@ GEM
rake (0.9.2)
rb-fsevent (0.4.3.1)
rcov (0.9.10)
- rdoc (3.9.2)
+ rdoc (3.9.3)
routing-filter (0.2.4)
actionpack
rspec (2.6.0)
@@ -243,7 +241,7 @@ GEM
actionpack (~> 3.1.0.rc6)
railties (~> 3.1.0.rc6)
sass (>= 3.1.4)
- selenium-webdriver (2.4.0)
+ selenium-webdriver (2.5.0)
childprocess (>= 0.2.1)
ffi (>= 1.0.7)
json_pure
@@ -271,6 +269,7 @@ GEM
multi_json (>= 1.0.2)
warden (1.0.5)
rack (>= 1.0)
+ will_paginate (3.0.0)
xpath (0.1.4)
nokogiri (~> 1.3)
@@ -1,4 +1,4 @@
-<%= paginate @users %>
+<%= will_paginate @users %>
<ul>
<%= render :partial => "user", :collection => @users %>
</ul>
View
@@ -1,7 +1,6 @@
## 2.0.0 [unreleased]
* Finally removed `Page#[]` in favour of `Page#content_for` so instead of `@page[:body]` it's `@page.content_for(:body)`. [Philip Arndt](https://github.com/parndt)
-* Migrated to [Kaminari](https://github.com/amatsuda/kaminari) for pagination. [Uģis Ozols](https://github.com/ugisozols)
* Moved everything under Refinery namespace. [wakeless](https://github.com/wakeless)
* Renamed `RefinerySetting` to `Refinery::Setting`. [Philip Arndt](https://github.com/parndt)
* Added `--trace` option to bin/refinerycms. [Steven Heidel](http://github.com/stevenheidel)
@@ -64,7 +64,7 @@ init_ajaxy_pagination = function(){
var pagination_pages = $('.pagination_container .pagination a');
pagination_pages.live('click',function(e) {
navigate_to = this.href.replace(/(\&(amp\;)?)?from_page\=\d+/, '');
- navigate_to += '&from_page=' + $('.page.current').text();
+ navigate_to += '&from_page=' + $('.current').text();
navigate_to = navigate_to.replace('?&', '?').replace(/\s+/, '');
var current_state_location = (location.pathname + location.href.split(location.pathname)[1]);
@@ -1,11 +0,0 @@
-<%# Link to the "Next" page
- - available local variables
- url: url to the next page
- current_page: a page object for the currently displayed page
- num_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote
--%>
-<span class="next">
- <%= link_to_unless current_page.last?, raw(t 'pagination.next'), url, :rel => 'next', :remote => remote %>
-</span>
@@ -1,21 +0,0 @@
-<%# The container tag
- - available local variables
- current_page: a page object for the currently displayed page
- num_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote
- paginator: the paginator that renders the pagination tags inside
--%>
-<%= paginator.render do -%>
- <nav class="pagination">
- <%= prev_page_tag unless current_page.first? %>
- <% each_page do |page| -%>
- <% if page.left_outer? || page.right_outer? || page.inside_window? -%>
- <%= page_tag page %>
- <% elsif !page.was_truncated? -%>
- <%= gap_tag %>
- <% end -%>
- <% end -%>
- <%= next_page_tag unless current_page.last? %>
- </nav>
-<% end -%>
@@ -1,12 +0,0 @@
-<%# Link to the "Previous" page
- - available local variables
- url: url to the previous page
- current_page: a page object for the currently displayed page
- num_pages: total number of pages
- per_page: number of items to fetch per page
- remote: data-remote
--%>
-<span class="prev">
- <%= link_to_unless current_page.first?, raw(t 'previous', :scope => 'pagination'), url,
- :rel => 'prev', :remote => remote %>
-</span>
@@ -1,10 +0,0 @@
-module Kaminari
- module Helpers
- class Tag
- # Handle isolate_namespace properly
- def page_url_for(page)
- @template.main_app.url_for @params.merge(@param_name => (page unless page <= 1))
- end
- end
- end
-end
@@ -0,0 +1,18 @@
+module WillPaginate
+ module ActionView
+ class LinkRenderer < ViewHelpers::LinkRenderer
+ def url(page)
+ @base_url_params ||= begin
+ url_params = base_url_params
+ merge_optional_params(url_params)
+ url_params
+ end
+
+ url_params = @base_url_params.dup
+ add_current_page_param(url_params, page)
+
+ @template.main_app.url_for(url_params)
+ end
+ end
+ end
+end
@@ -74,6 +74,6 @@ bg:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -73,6 +73,6 @@ cs:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ da:
time:
formats:
short: "%A, %e. %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ de:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ el:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -74,6 +74,6 @@ en:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -64,6 +64,6 @@ es:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -74,3 +74,6 @@ fi:
time:
formats:
short: "%A, %d %B %Y"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -68,6 +68,6 @@ fr:
enable_javascript: Pour obtenir l'ensemble des fonctionnalités de cette page il est nécessaire d'activer JavaScript.
here_are: Ici sont les
instructions_enable_javascript: instructions pour activer JavaScript dans votre navigateur
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -76,6 +76,6 @@ it:
enable_javascript: È necessario che JavaScript sia abilitato per poter visualizzare correttamente questa pagina.
here_are: ""
instructions_enable_javascript: Istruzioni su come attivare JavaScript nel tuo browser
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ jp:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -74,6 +74,6 @@ ko:
time:
formats:
short: "%Y년 %m월 %d일 (%a)"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -64,6 +64,6 @@ lolcat:
not_live: DIS PAEG IZ NOT LIV 4 PUBLIC VIEWIN.
footer:
copyright: COPYRIGHT © %{year} %{site_name}
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ lt:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -68,6 +68,6 @@ lv:
enable_javascript: Lai lapa pilnībā funkcionalētu ir nepieciešams iespējot JavaScript.
here_are: Šeit ir
instructions_enable_javascript: instrukcija kā iespējot JavaScript jūsu pārlūkprogrammā
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ nb:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ nl:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ pl:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -68,6 +68,6 @@ pt-BR:
enable_javascript: Para ter todas as funcionalidades dessa página é necessário ter JavaScript habilitado.
here_are: Aqui estão as
instructions_enable_javascript: instruções para habilitar JavaScript no seu navegador.
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ rs:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -67,6 +67,6 @@ ru:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
@@ -71,6 +71,6 @@ sk:
time:
formats:
short: "%A, %d %B %Y"
- pagination:
- next: "&raquo;"
- previous: "&laquo;"
+ will_paginate:
+ previous_label: "&laquo;"
+ next_label: "&raquo;"
Oops, something went wrong.

0 comments on commit 6828e71

Please sign in to comment.