Use partial for severed relationship download area (#35945)

pull/35960/head
Matt Jankowski 3 months ago committed by GitHub
parent ee4b0a223c
commit 40242fafee
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,6 @@
-# locals(count:, link:)
- if count.zero?
= t('generic.none')
- else
= table_link_to 'download', t('severed_relationships.download', count:), link

@ -0,0 +1,14 @@
-# locals(event:)
%tr
%td
%time.formatted{ datetime: event.created_at.iso8601, title: l(event.created_at) }
= l(event.created_at)
%td= t("severed_relationships.event_type.#{event.type}", target_name: event.target_name)
- if event.purged?
%td{ rowspan: 2 }= t('severed_relationships.purged')
- else
%td
= render 'download', count: event.following_count, link: following_severed_relationship_path(event, format: :csv)
%td
= render 'download', count: event.followers_count, link: followers_severed_relationship_path(event, format: :csv)

@ -13,24 +13,4 @@
%th= t('severed_relationships.lost_follows')
%th= t('severed_relationships.lost_followers')
%tbody
- @events.each do |event|
%tr
%td
%time.formatted{ datetime: event.created_at.iso8601, title: l(event.created_at) }
= l(event.created_at)
%td= t("severed_relationships.event_type.#{event.type}", target_name: event.target_name)
- if event.purged?
%td{ rowspan: 2 }= t('severed_relationships.purged')
- else
%td
- count = event.following_count
- if count.zero?
= t('generic.none')
- else
= table_link_to 'download', t('severed_relationships.download', count: count), following_severed_relationship_path(event, format: :csv)
%td
- count = event.followers_count
- if count.zero?
= t('generic.none')
- else
= table_link_to 'download', t('severed_relationships.download', count: count), followers_severed_relationship_path(event, format: :csv)
= render partial: 'event', collection: @events

Loading…
Cancel
Save