No need for turbo frames after all

This commit is contained in:
Jason Zimdars
2024-11-14 12:30:05 -06:00
parent ba861544fc
commit f7d7ea6e49
5 changed files with 27 additions and 29 deletions
@@ -1,4 +1,4 @@
class Bubbles::AssignmentsController < ApplicationController
class AssignmentsController < ApplicationController
include BubbleScoped, BucketScoped
def new
+24
View File
@@ -0,0 +1,24 @@
<% if bubble.assignments.any? %>
<div class="bubble__bubble bubble__meta bubble__assignee">
<%= form_with url: bucket_bubble_assignments_path(bubble.bucket, bubble), data: { controller: "form" } do |form| %>
<label class="btn btn--plain position-relative fill-transparent" style="<%= "--btn-icon-size: 2em;" unless bubble.assignees.any? %>">
<% if bubble.assignees.any? %>
<% if bubble.assignees.many? %>
<div class="avatar__group">
<% bubble.assignees.each do |assignee| %>
<%= avatar_image_tag assignee, loading: :lazy, class: "avatar flex-item-no-shrink" %>
<% end %>
</div>
<% else %>
<%= avatar_image_tag bubble.assignees.first, loading: :lazy, class: "avatar flex-item-no-shrink" %>
<% end %>
<% end %>
<%= form.collection_select :assignee_id, bubble.bucket.users.active, :id, :name, { prompt: "Assign to…", selected: bubble.assignees.pluck(:id) },
class: "input input--hidden txt-medium",
data: { action: "change->form#submit click->form#showPicker" } %>
<span class="for-screen-reader">Assign to…</span>
</label>
<% end %>
</div>
<% end %>
+1 -1
View File
@@ -16,7 +16,7 @@
<span class="for-screen-reader"><%= bubble.title %></span>
<% end %>
<%= turbo_frame_tag dom_id(bubble, :assignments), src: bucket_bubble_assignments_path(bubble.bucket, bubble) %>
<%= render "bubbles/assignments", bubble: bubble %>
<%= render "bubbles/boosts", bubble: bubble %>
<%= render "bubbles/color", bubble: bubble %>
<%= turbo_frame_tag dom_id(bubble, :date_picker), src: bucket_bubble_date_picker_path(bubble.bucket, bubble) %>
@@ -1,26 +0,0 @@
<%= turbo_frame_tag dom_id(@bubble, :assignments) do %>
<% if @bubble.assignments.any? %>
<div class="bubble__bubble bubble__meta bubble__assignee">
<%= form_with url: bucket_bubble_assignments_path(@bubble.bucket, @bubble), data: { controller: "form", turbo_frame: "_top" } do |form| %>
<label class="btn btn--plain position-relative fill-transparent" style="<%= "--btn-icon-size: 2em;" unless @bubble.assignees.any? %>">
<% if @bubble.assignees.any? %>
<% if @bubble.assignees.many? %>
<div class="avatar__group">
<% @bubble.assignees.each do |assignee| %>
<%= avatar_image_tag assignee, loading: :lazy, class: "avatar flex-item-no-shrink" %>
<% end %>
</div>
<% else %>
<%= avatar_image_tag @bubble.assignees.first, loading: :lazy, class: "avatar flex-item-no-shrink" %>
<% end %>
<% end %>
<%= form.collection_select :assignee_id, @bubble.bucket.users.active, :id, :name, { prompt: "Assign to…", selected: @bubble.assignees.pluck(:id) },
class: "input input--hidden txt-medium",
data: { action: "change->form#submit click->form#showPicker" } %>
<span class="for-screen-reader">Assign to…</span>
</label>
<% end %>
</div>
<% end %>
<% end %>
+1 -1
View File
@@ -16,6 +16,7 @@ Rails.application.routes.draw do
resources :buckets do
resources :bubbles do
resources :assignments
resources :boosts
resources :comments
resources :tags, shallow: true
@@ -25,7 +26,6 @@ Rails.application.routes.draw do
resource :pop
resource :stage_picker
resource :date_picker
resource :assignments
resources :stagings
end
end