mobile: added will paginate for bootstrap
This commit is contained in:
parent
0419ca0bb6
commit
3f26c0e3d7
5 changed files with 15 additions and 4 deletions
2
Gemfile
2
Gemfile
|
|
@ -105,7 +105,7 @@ gem 'typhoeus'
|
||||||
gem 'haml'
|
gem 'haml'
|
||||||
gem 'mobile-fu'
|
gem 'mobile-fu'
|
||||||
gem 'sass'
|
gem 'sass'
|
||||||
gem 'will_paginate'
|
gem 'bootstrap-will_paginate'
|
||||||
gem 'client_side_validations'
|
gem 'client_side_validations'
|
||||||
|
|
||||||
# web
|
# web
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
- if @contacts.size > 0
|
- if @contacts.size > 0
|
||||||
- for contact in @contacts
|
- for contact in @contacts
|
||||||
= render 'people/person', :person => contact.person, :contact => contact
|
= render 'people/person', :person => contact.person, :contact => contact
|
||||||
= will_paginate @contacts
|
= will_paginate @contacts, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
|
||||||
- else
|
- else
|
||||||
%h3.no_contacts
|
%h3.no_contacts
|
||||||
= t('.no_contacts')
|
= t('.no_contacts')
|
||||||
|
|
|
||||||
|
|
@ -21,4 +21,4 @@
|
||||||
.time
|
.time
|
||||||
= time_ago_in_words(note.created_at)
|
= time_ago_in_words(note.created_at)
|
||||||
|
|
||||||
= will_paginate @notifications
|
= will_paginate @notifications, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
|
||||||
|
|
|
||||||
|
|
@ -32,5 +32,5 @@
|
||||||
- for hash in @hashes
|
- for hash in @hashes
|
||||||
= render :partial => 'people/person', :locals => hash
|
= render :partial => 'people/person', :locals => hash
|
||||||
|
|
||||||
= will_paginate @people
|
= will_paginate @people, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1 +1,12 @@
|
||||||
require 'will_paginate/array'
|
require 'will_paginate/array'
|
||||||
|
|
||||||
|
# Optional for Bootstrap :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
|
||||||
|
# https://github.com/yrgoldteeth/bootstrap-will_paginate
|
||||||
|
|
||||||
|
module WillPaginate
|
||||||
|
module ActionView
|
||||||
|
def will_paginate(collection = nil, options = { :renderer => WillPaginate::ActionView::LinkRenderer } )
|
||||||
|
super.try :html_safe
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue