Paginate descendant statuses in public page (#7148)
This commit is contained in:
parent
06817b3c1f
commit
1258efa882
8 changed files with 146 additions and 22 deletions
2
app/views/stream_entries/_more.html.haml
Normal file
2
app/views/stream_entries/_more.html.haml
Normal file
|
@ -0,0 +1,2 @@
|
|||
= link_to url, class: 'more light' do
|
||||
= t('statuses.show_more')
|
|
@ -16,8 +16,7 @@
|
|||
- if status.reply? && include_threads
|
||||
- if @next_ancestor
|
||||
.entry{ class: entry_classes }
|
||||
= link_to short_account_status_url(@next_ancestor.account.username, @next_ancestor), class: 'more light' do
|
||||
= t('statuses.show_more')
|
||||
= render 'stream_entries/more', url: short_account_status_url(@next_ancestor.account.username, @next_ancestor)
|
||||
= render partial: 'stream_entries/status', collection: @ancestors, as: :status, locals: { is_predecessor: true, direct_reply_id: status.in_reply_to_id }
|
||||
|
||||
.entry{ class: entry_classes }
|
||||
|
@ -40,4 +39,14 @@
|
|||
= render (centered ? 'stream_entries/detailed_status' : 'stream_entries/simple_status'), status: status.proper
|
||||
|
||||
- if include_threads
|
||||
= render partial: 'stream_entries/status', collection: @descendants, as: :status, locals: { is_successor: true, parent_id: status.id }
|
||||
- if @since_descendant_thread_id
|
||||
.entry{ class: entry_classes }
|
||||
= render 'stream_entries/more', url: short_account_status_url(status.account.username, status, max_descendant_thread_id: @since_descendant_thread_id + 1)
|
||||
- @descendant_threads.each do |thread|
|
||||
= render partial: 'stream_entries/status', collection: thread[:statuses], as: :status, locals: { is_successor: true, parent_id: status.id }
|
||||
- if thread[:next_status]
|
||||
.entry{ class: entry_classes }
|
||||
= render 'stream_entries/more', url: short_account_status_url(thread[:next_status].account.username, thread[:next_status])
|
||||
- if @next_descendant_thread
|
||||
.entry{ class: entry_classes }
|
||||
= render 'stream_entries/more', url: short_account_status_url(status.account.username, status, since_descendant_thread_id: @max_descendant_thread_id - 1)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue