Use partial for severed relationship download area (#35945)
This commit is contained in:
6
app/views/severed_relationships/_download.html.haml
Normal file
6
app/views/severed_relationships/_download.html.haml
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-# locals(count:, link:)
|
||||||
|
|
||||||
|
- if count.zero?
|
||||||
|
= t('generic.none')
|
||||||
|
- else
|
||||||
|
= table_link_to 'download', t('severed_relationships.download', count:), link
|
||||||
14
app/views/severed_relationships/_event.html.haml
Normal file
14
app/views/severed_relationships/_event.html.haml
Normal file
@@ -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_follows')
|
||||||
%th= t('severed_relationships.lost_followers')
|
%th= t('severed_relationships.lost_followers')
|
||||||
%tbody
|
%tbody
|
||||||
- @events.each do |event|
|
= render partial: 'event', collection: @events
|
||||||
%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)
|
|
||||||
|
|||||||
Reference in New Issue
Block a user