summaryrefslogtreecommitdiff
path: root/app/views/application/_chat.html.erb
blob: 1ba6f8f5cb22c72cd0aa218f2db2e2c9c68e031f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
<% if current_char %>
  <div data-controller="chat" class="flex flex-col h-full text-sm">
    <div data-chat-target="output" id="chat_output" class="game-container-box overflow-y-auto overflow-x-hidden break-words flex-grow">
    </div>
    <div class="flex-none">
      <div class="flex items-center">
        <div class="flex-grow">
          <%= form_with model: ChatMessage.new, html: { autocomplete: "off" }, local: false,
                        data: { action: "chat#send" }, class: "flex" do |f| %>
            <%= f.collection_select :chat_room_id, ChatRoom.accessible_to(current_char.user),
                                    :id, :short_name, class: "flex-none" %>
            <%= f.text_field :body, size: "1", maxlength: 255, required: true,
                             data: { chat_target: "message" }, class: "flex-grow inline-flex" %>
          <% end %>
        </div>
        <div class="flex-none text-xs mx-2">
          <%= link_to "History", chat_messages_path %>
        </div>
      </div>
    </div>
  </div>
<% end %>