fedibird-fe/app/views/statuses/_reference_status.html.haml

29 lines
1.2 KiB
Text
Raw Normal View History

2022-03-17 14:25:16 +00:00
:ruby
is_predecessor ||= false
is_successor ||= false
direct_reply_id ||= false
parent_id ||= false
is_direct_parent = direct_reply_id == status.id
is_direct_child = parent_id == status.in_reply_to_id
centered ||= !is_predecessor && !is_successor
h_class = microformats_h_class(status, is_predecessor, is_successor, true)
style_classes = style_classes(status, is_predecessor, is_successor, true)
mf_classes = microformats_classes(status, is_direct_parent, is_direct_child)
entry_classes = h_class + ' ' + mf_classes + ' ' + style_classes
- if max_id
.entry{ class: entry_classes }
= link_to_older references_short_account_status_url(status.account.username, status, max_id: max_id)
= render partial: 'statuses/status', collection: @references, as: :status, locals: { is_predecessor: true, direct_reply_id: status.in_reply_to_id }
- if min_id
.entry{ class: entry_classes }
= link_to_newer references_short_account_status_url(status.account.username, status, min_id: min_id)
- if !embedded_view? && !user_signed_in?
.entry{ class: entry_classes }
= link_to new_user_session_path, class: 'load-more load-gap' do
= fa_icon 'comments'
= t('statuses.sign_in_to_participate')