diff --git a/app/controllers/prompts/collections/users_controller.rb b/app/controllers/prompts/collections/users_controller.rb new file mode 100644 index 000000000..22c74cd58 --- /dev/null +++ b/app/controllers/prompts/collections/users_controller.rb @@ -0,0 +1,8 @@ +class Prompts::Collections::UsersController < ApplicationController + include CollectionScoped + + def index + @users = @collection.users + render layout: false + end +end diff --git a/app/controllers/prompts/users_controller.rb b/app/controllers/prompts/users_controller.rb deleted file mode 100644 index 1aaf995c4..000000000 --- a/app/controllers/prompts/users_controller.rb +++ /dev/null @@ -1,6 +0,0 @@ -class Prompts::UsersController < ApplicationController - def index - @users = User.all - render layout: false - end -end diff --git a/app/helpers/rich_text_helper.rb b/app/helpers/rich_text_helper.rb index 42c7cf5f1..2e0b63a93 100644 --- a/app/helpers/rich_text_helper.rb +++ b/app/helpers/rich_text_helper.rb @@ -1,6 +1,6 @@ module RichTextHelper - def mentions_prompt - content_tag "lexical-prompt", "", trigger: "@", src: prompts_users_path, name: "mention" + def mentions_prompt(collection) + content_tag "lexical-prompt", "", trigger: "@", src: prompts_collection_users_path(collection), name: "mention" end def cards_prompt diff --git a/app/views/cards/comments/_new.html.erb b/app/views/cards/comments/_new.html.erb index 8237fda1e..07802b0f0 100644 --- a/app/views/cards/comments/_new.html.erb +++ b/app/views/cards/comments/_new.html.erb @@ -11,7 +11,7 @@ action: "turbo:submit-end->local-save#submit keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel:stop" } do |form| %> <%= form.rich_textarea :body, required: true, placeholder: new_comment_placeholder(card), data: { local_save_target: "input", action: "actiontext:change->local-save#save turbo:morph-element->local-save#restoreContent" } do %> - <%= mentions_prompt %> + <%= mentions_prompt(@card.collection) %> <%= cards_prompt %> <% end %> <%= form.button class: "comment__submit btn btn--reversed flex-item-justify-start" do %> diff --git a/app/views/cards/comments/edit.html.erb b/app/views/cards/comments/edit.html.erb index ebf55a8b1..d236e1b79 100644 --- a/app/views/cards/comments/edit.html.erb +++ b/app/views/cards/comments/edit.html.erb @@ -9,7 +9,7 @@ <%= form_with model: [ @card, @comment ], class: "flex flex-column gap full-width", data: { controller: "form", action: "keydown.ctrl+enter->form#submit:prevent keydown.meta+enter->form#submit:prevent keydown.esc->form#cancel:stop" } do |form| %> <%= form.rich_textarea :body, required: true, autofocus: true, placeholder: new_comment_placeholder(@card) do %> - <%= mentions_prompt %> + <%= mentions_prompt(@card.collection) %> <%= cards_prompt %> <% end %>