diff --git a/app/controllers/assignments_controller.rb b/app/controllers/bubbles/assignments_controller.rb similarity index 63% rename from app/controllers/assignments_controller.rb rename to app/controllers/bubbles/assignments_controller.rb index 05ce8a5b5..4ca0d7031 100644 --- a/app/controllers/assignments_controller.rb +++ b/app/controllers/bubbles/assignments_controller.rb @@ -1,9 +1,15 @@ -class AssignmentsController < ApplicationController +class Bubbles::AssignmentsController < ApplicationController include BubbleScoped, BucketScoped + def new + end + + def show + end + def create @bubble.assign(find_assignee) - redirect_to @bubble + render :show end private diff --git a/app/views/bubbles/_assignments.html.erb b/app/views/bubbles/_assignments.html.erb deleted file mode 100644 index 143c6fa07..000000000 --- a/app/views/bubbles/_assignments.html.erb +++ /dev/null @@ -1,26 +0,0 @@ - id="new-assignee" class="bubble__bubble bubble__meta bubble__assignee <%= "bubble__assignee--new" if bubble.assignees.none? %>"> - <%= form_with url: bucket_bubble_assignments_path(bubble.bucket, bubble), data: { controller: "form" } do |form| %> - - - <%= form.submit "Save", class: "btn", hidden: true %> - <% end %> - diff --git a/app/views/bubbles/_bubble.html.erb b/app/views/bubbles/_bubble.html.erb index 03ea60bf3..9cbffe4c1 100644 --- a/app/views/bubbles/_bubble.html.erb +++ b/app/views/bubbles/_bubble.html.erb @@ -16,7 +16,7 @@ <%= bubble.title %> <% end %> - <%= render "bubbles/assignments", bubble: bubble %> + <%= turbo_frame_tag dom_id(bubble, :assignments), src: bucket_bubble_assignments_path(bubble.bucket, 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) %> diff --git a/app/views/bubbles/assignments/new.html.erb b/app/views/bubbles/assignments/new.html.erb new file mode 100644 index 000000000..60330a618 --- /dev/null +++ b/app/views/bubbles/assignments/new.html.erb @@ -0,0 +1,14 @@ +<%= turbo_frame_tag dom_id(@bubble, :assignments) do %> + <%= form_with url: bucket_bubble_assignments_path(@bubble.bucket, @bubble), data: { controller: "form" } do |form| %> +
+ + <%= form.submit "Save", class: "btn", hidden: true %> +
+ <% end %> +<% end %> diff --git a/app/views/bubbles/assignments/show.html.erb b/app/views/bubbles/assignments/show.html.erb new file mode 100644 index 000000000..7d7c7c9fc --- /dev/null +++ b/app/views/bubbles/assignments/show.html.erb @@ -0,0 +1,28 @@ +<%= turbo_frame_tag dom_id(@bubble, :assignments) do %> + <% if @bubble.assignments.any? %> +
+ <%= form_with url: bucket_bubble_assignments_path(@bubble.bucket, @bubble), data: { controller: "form" } do |form| %> + + + <%= form.submit "Save", class: "btn", hidden: true %> + <% end %> +
+ <% end %> +<% end %> diff --git a/app/views/bubbles/show.html.erb b/app/views/bubbles/show.html.erb index 3b81368a9..de6aed524 100644 --- a/app/views/bubbles/show.html.erb +++ b/app/views/bubbles/show.html.erb @@ -24,12 +24,19 @@