diff --git a/app/controllers/prompts/commands_controller.rb b/app/controllers/prompts/commands_controller.rb new file mode 100644 index 000000000..85709922c --- /dev/null +++ b/app/controllers/prompts/commands_controller.rb @@ -0,0 +1,7 @@ +class Prompts::CommandsController < ApplicationController + def index + if stale? etag: @tags + render layout: false + end + end +end diff --git a/app/helpers/rich_text_helper.rb b/app/helpers/rich_text_helper.rb index 8cd4cf36c..986e24fd0 100644 --- a/app/helpers/rich_text_helper.rb +++ b/app/helpers/rich_text_helper.rb @@ -11,6 +11,10 @@ module RichTextHelper content_tag "lexical-prompt", "", trigger: "#", src: prompts_tags_path, name: "tag" end + def commands_prompt + content_tag "lexical-prompt", "", trigger: "/", src: prompts_commands_path, name: "command", "insert-editable-text": true + end + def cards_prompt content_tag "lexical-prompt", "", trigger: "#", src: prompts_cards_path, name: "card", "insert-editable-text": true, "remote-filtering": true end diff --git a/app/views/commands/_form.html.erb b/app/views/commands/_form.html.erb index 7997dfcd7..58a008ca5 100644 --- a/app/views/commands/_form.html.erb +++ b/app/views/commands/_form.html.erb @@ -31,6 +31,7 @@ spellcheck: "false" do %> <%= global_mentions_prompt %> <%= tags_prompt %> + <%= commands_prompt %> <% end %> <%= hidden_field_tag "confirmed", nil, data: { terminal_target: "confirmation" } %> diff --git a/app/views/prompts/commands/index.html.erb b/app/views/prompts/commands/index.html.erb new file mode 100644 index 000000000..28685d139 --- /dev/null +++ b/app/views/prompts/commands/index.html.erb @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + diff --git a/config/routes.rb b/config/routes.rb index 4026c9c25..4e17f0819 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -118,6 +118,7 @@ Rails.application.routes.draw do resources :cards resources :users resources :tags + resources :commands resources :collections do scope module: :collections do