add inbox pagination

This commit is contained in:
Andreas N 2015-02-12 21:59:46 +01:00
parent 4a8ea35ead
commit e3bc0d6300
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,12 @@
- @inbox.each do |i|
= render 'inbox/entry', i: i
#pagination= will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false
- if @inbox.next_page
%button#load-more-btn.btn.btn-default{type: :button, data: { current_page: @inbox.current_page }}
Load more
- if @inbox.empty?
Nothing to see here.

View File

@ -0,0 +1,8 @@
$('#timeline').append('<% @timeline.each do |answer|
%><%= j render 'inbox/entry', a: answer
%><% end %>');
<% if @timeline.next_page %>
$('#pagination').html('<%= j will_paginate @inbox, renderer: BootstrapPagination::Rails, page_links: false %>');
<% else %>
$('#pagination, #load-more-btn').remove();
<% end %>