mirror of
https://github.com/Retrospring/retrospring.git
synced 2024-11-20 12:39:53 +01:00
add inbox pagination
This commit is contained in:
parent
4a8ea35ead
commit
e3bc0d6300
2 changed files with 14 additions and 0 deletions
|
@ -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.
|
||||
|
|
8
app/views/inbox/show.js.erb
Normal file
8
app/views/inbox/show.js.erb
Normal 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 %>
|
Loading…
Reference in a new issue