From a830ec19993a0d5ce70f4aefafc466251256c2f4 Mon Sep 17 00:00:00 2001 From: Mike Dalessio Date: Fri, 21 Mar 2025 16:41:40 -0400 Subject: [PATCH] Extract an "assignees" partial pulling the avatars down from the "people" partial, and pulling the add button up from the "assignment" partial. The result is: - the "bubbles/sidebar/assignment" partial is just the dialog box - the "bubbles/assignees" partial contains everything about assignees - the "bubbles/people" partial makes one render call and I've introduced some turbo frames in the expectation of the next commit which will load the dialog in the background. --- app/views/bubbles/_assignees.html.erb | 18 ++++++++++++++++++ app/views/bubbles/_people.html.erb | 9 ++------- app/views/bubbles/sidebar/_assignment.html.erb | 11 +++-------- 3 files changed, 23 insertions(+), 15 deletions(-) create mode 100644 app/views/bubbles/_assignees.html.erb diff --git a/app/views/bubbles/_assignees.html.erb b/app/views/bubbles/_assignees.html.erb new file mode 100644 index 000000000..f054bb3ed --- /dev/null +++ b/app/views/bubbles/_assignees.html.erb @@ -0,0 +1,18 @@ +<%= turbo_frame_tag bubble, :assignees do %> +
+ <% bubble.assignees.each do |assignee| %> + <%= avatar_tag assignee, loading: :lazy, class: "avatar" %> + <% end %> + +
+ + + + <%= render "bubbles/sidebar/assignment", bubble: bubble %> + +
+
+<% end %> diff --git a/app/views/bubbles/_people.html.erb b/app/views/bubbles/_people.html.erb index daf4e311f..68268ce55 100644 --- a/app/views/bubbles/_people.html.erb +++ b/app/views/bubbles/_people.html.erb @@ -6,12 +6,7 @@
Assigned -
- <% bubble.assignees.each do |assignee| %> - <%= avatar_tag assignee, loading: :lazy, class: "avatar" %> - <% end %> - <%= render "bubbles/sidebar/assignment", bubble: bubble, users: bubble.bucket.users.active %> -
+ <%= render "bubbles/assignees", bubble: bubble %>
- \ No newline at end of file + diff --git a/app/views/bubbles/sidebar/_assignment.html.erb b/app/views/bubbles/sidebar/_assignment.html.erb index 8610cf086..72dc42976 100644 --- a/app/views/bubbles/sidebar/_assignment.html.erb +++ b/app/views/bubbles/sidebar/_assignment.html.erb @@ -1,14 +1,9 @@ -
- - +<%= turbo_frame_tag bubble, :assignment do %> Assign this to… <%= form_with url: bucket_bubble_assignment_toggles_path(bubble.bucket, bubble), class: "flex flex-column full-width popup__list", data: { controller: "form" } do |form| %> - <% users.sort_by(&:name).each do |user| %> + <% bubble.bucket.users.active.sort_by(&:name).each do |user| %> -
+<% end %>