From 56a3f6612a7c1fffb2db49330376abaee2871d50 Mon Sep 17 00:00:00 2001 From: Jorge Manrubia Date: Fri, 4 Apr 2025 16:36:40 +0200 Subject: [PATCH] Extract common layout for assignees --- .../bubbles/cards/common/_assignees.html.erb | 16 ++++++++++++++++ .../bubbles/cards/perma/_assignees.html.erb | 17 ++--------------- .../bubbles/cards/preview/_assignees.html.erb | 8 +------- 3 files changed, 19 insertions(+), 22 deletions(-) create mode 100644 app/views/bubbles/cards/common/_assignees.html.erb diff --git a/app/views/bubbles/cards/common/_assignees.html.erb b/app/views/bubbles/cards/common/_assignees.html.erb new file mode 100644 index 000000000..70cefba5d --- /dev/null +++ b/app/views/bubbles/cards/common/_assignees.html.erb @@ -0,0 +1,16 @@ +<%= turbo_frame_tag bubble, :assignees do %> +
+ <% bubble.assignees.each do |assignee| %> + <%= avatar_tag assignee, loading: :lazy, class: "avatar" %> + <% end %> + +
+ + + <%= yield %> +
+
+<% end %> diff --git a/app/views/bubbles/cards/perma/_assignees.html.erb b/app/views/bubbles/cards/perma/_assignees.html.erb index 603c0ef7d..b9ef3d6db 100644 --- a/app/views/bubbles/cards/perma/_assignees.html.erb +++ b/app/views/bubbles/cards/perma/_assignees.html.erb @@ -1,16 +1,3 @@ -<%= turbo_frame_tag bubble, :assignees do %> -
- <% bubble.assignees.each do |assignee| %> - <%= avatar_tag assignee, loading: :lazy, class: "avatar" %> - <% end %> - -
- - - <%= turbo_frame_tag bubble, :assignment, src: new_bucket_bubble_assignment_toggle_path(bubble.bucket, bubble) %> -
-
+<%= render "bubbles/cards/common/assignees", bubble: bubble do %> + <%= turbo_frame_tag bubble, :assignment, src: new_bucket_bubble_assignment_toggle_path(bubble.bucket, bubble) %> <% end %> diff --git a/app/views/bubbles/cards/preview/_assignees.html.erb b/app/views/bubbles/cards/preview/_assignees.html.erb index b9ba62581..ae3301ea1 100644 --- a/app/views/bubbles/cards/preview/_assignees.html.erb +++ b/app/views/bubbles/cards/preview/_assignees.html.erb @@ -1,7 +1 @@ -<%= turbo_frame_tag bubble, :assignees do %> -
- <% bubble.assignees.each do |assignee| %> - <%= avatar_tag assignee, loading: :lazy, class: "avatar" %> - <% end %> -
-<% end %> +<%= render "bubbles/cards/common/assignees", bubble: bubble %>