mobile: added will paginate for bootstrap

This commit is contained in:
Diaspora Europe 2012-03-14 15:19:24 +01:00
parent 0419ca0bb6
commit 3f26c0e3d7
5 changed files with 15 additions and 4 deletions

View file

@ -105,7 +105,7 @@ gem 'typhoeus'
gem 'haml'
gem 'mobile-fu'
gem 'sass'
gem 'will_paginate'
gem 'bootstrap-will_paginate'
gem 'client_side_validations'
# web

View file

@ -17,7 +17,7 @@
- if @contacts.size > 0
- for contact in @contacts
= render 'people/person', :person => contact.person, :contact => contact
= will_paginate @contacts
= will_paginate @contacts, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer
- else
%h3.no_contacts
= t('.no_contacts')

View file

@ -21,4 +21,4 @@
.time
= time_ago_in_words(note.created_at)
= will_paginate @notifications
= will_paginate @notifications, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer

View file

@ -32,5 +32,5 @@
- for hash in @hashes
= render :partial => 'people/person', :locals => hash
= will_paginate @people
= will_paginate @people, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer

View file

@ -1 +1,12 @@
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