diff --git a/app/views/contacts/index.mobile.haml b/app/views/contacts/index.mobile.haml index b0c74893a..aa6044cc3 100644 --- a/app/views/contacts/index.mobile.haml +++ b/app/views/contacts/index.mobile.haml @@ -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') diff --git a/app/views/notifications/index.mobile.haml b/app/views/notifications/index.mobile.haml index 6ea77428d..c19d28b47 100644 --- a/app/views/notifications/index.mobile.haml +++ b/app/views/notifications/index.mobile.haml @@ -8,7 +8,8 @@ - @group_days.each do |day, notes| %li .notification_day_header - = day + %span.label + = day %ul.notifications_for_day - notes.each do |note| .stream_element{:data=>{:guid => note.id}, :class => "#{note.unread ? 'unread' : ''}"} @@ -21,4 +22,4 @@ .time = time_ago_in_words(note.created_at) - = will_paginate @notifications + = will_paginate @notifications, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer diff --git a/app/views/people/index.mobile.haml b/app/views/people/index.mobile.haml index 7101e929b..d93c79d04 100644 --- a/app/views/people/index.mobile.haml +++ b/app/views/people/index.mobile.haml @@ -32,5 +32,5 @@ - for hash in @hashes = render :partial => 'people/person', :locals => hash - = will_paginate @people + = will_paginate @people, :renderer => WillPaginate::ActionView::BootstrapLinkRenderer diff --git a/config/initializers/will_paginate.rb b/config/initializers/will_paginate.rb index dfed3fe9e..69626fd72 100644 --- a/config/initializers/will_paginate.rb +++ b/config/initializers/will_paginate.rb @@ -1 +1,32 @@ 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 + + class BootstrapLinkRenderer < LinkRenderer + protected + + def html_container(html) + tag :div, tag(:ul, html), container_attributes + end + + def page_number(page) + tag :li, link(page, page, :rel => rel_value(page)), :class => ('active' if page == current_page) + end + + def gap + tag :li, link(super, '#'), :class => 'disabled' + end + + def previous_or_next_page(page, text, classname) + tag :li, link(text, page || '#'), :class => [classname[0..3], classname, ('disabled' unless page)].join(' ') + end + end + end +end diff --git a/public/stylesheets/sass/mobile.scss b/public/stylesheets/sass/mobile.scss index a5a54d1ba..cc3ce2919 100644 --- a/public/stylesheets/sass/mobile.scss +++ b/public/stylesheets/sass/mobile.scss @@ -601,9 +601,17 @@ select { .navbar-fixed-top { position: fixed !important; - max-height: 45px !important; min-height: 45px !important; height: 45px !important; overflow: hidden; -} \ No newline at end of file +} + +.notifications { + list-style: none; +} + +.notification_day_header { + margin-bottom: 5px; +} +