add inbox pagination
This commit is contained in:
parent
4a8ea35ead
commit
e3bc0d6300
|
@ -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.
|
||||
|
|
|
@ -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 %>
|
Loading…
Reference in New Issue