52 lines
1.5 KiB
Plaintext
52 lines
1.5 KiB
Plaintext
<%= 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 %>
|
|
<div class="flex justify-center bar__placeholder" data-bar-target="buttonsContainer">
|
|
<%= tag.button \
|
|
class: "btn btn--plain",
|
|
data: {
|
|
controller: "hotkey",
|
|
action: "
|
|
bar#search
|
|
keydown.k@document->hotkey#click" } do %>
|
|
<span>Search <% if platform.desktop? -%><kbd>K</kbd><% end %></span>
|
|
<% 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 %>
|
|
<span>Ask <% if platform.desktop? -%><kbd>A</kbd><% end %></span>
|
|
<% end %>
|
|
<% end %>
|
|
</div>
|
|
|
|
<div class="bar__input" data-bar-target="searchInput" hidden>
|
|
<%= render "searches/form", query_terms: "" %>
|
|
</div>
|
|
|
|
<% if Current.user.staff? %>
|
|
<div class="bar__input" data-bar-target="askInput" hidden>
|
|
<%= render "conversations/composer" %>
|
|
</div>
|
|
<% 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 %>
|