No need for turbo frames after all
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
class Bubbles::AssignmentsController < ApplicationController
|
||||
class AssignmentsController < ApplicationController
|
||||
include BubbleScoped, BucketScoped
|
||||
|
||||
def new
|
||||
@@ -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 %>
|
||||
@@ -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
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user