%= tag.div \
class: "bar full-width",
data: {
controller: "bar",
bar_dialog_outlet: "#bar-modal",
bar_search_url_value: search_path,
bar_ask_url_value: conversation_path
} do %>
<%= tag.button \
class: "btn btn--plain",
data: {
controller: "hotkey",
action: "
bar#search
keydown.k@document->hotkey#click" } do %>
Search <% if platform.desktop? -%>K<% end %>
<% end %>
<% if Current.user.staff? %>
<%= tag.button \
class: "btn btn--plain visually-hidden",
data: {
controller: "hotkey",
action: "
bar#ask
keydown.a@document->hotkey#click" } do %>
Ask <% if platform.desktop? -%>A<% end %>
<% end %>
<% end %>
<%= render "searches/form", query_terms: "" %>
<% if Current.user.staff? %>
<%= render "conversations/composer" %>
<% end %>
<%= tag.dialog \
id: "bar-modal",
class: "bar__modal",
data: {
controller: "dialog",
dialog_target: "dialog",
action: "keydown.esc@document->bar#reset:stop" } do %>
<%= turbo_frame_tag "bar-content", data: { bar_target: "turboFrame" } %>
<% end %>
<% end %>