mirror of
https://github.com/rjNemo/phoenix_chat
synced 2026-06-06 02:16:42 +00:00
20 lines
709 B
Text
20 lines
709 B
Text
<h2>Currently chatting on <strong><%= @room_id %></strong> as <strong><%= @username %></strong></h2>
|
|
|
|
<section id="chat-container">
|
|
<ul id="chat-messages" phx-update="append">
|
|
<%= for message <- @messages do %>
|
|
<%= display_message(message) %>
|
|
<% end %>
|
|
</ul>
|
|
<article id="user-list">
|
|
<h3>Users online</h3>
|
|
<ul >
|
|
<%= for user <- @user_list do %>
|
|
<li><%= user %></li>
|
|
<% end %>
|
|
</ul>
|
|
</article>
|
|
</section>
|
|
<%= f = form_for :chat, "#", id: "chat-form", phx_submit: :submit_message, phx_change: :form_updated %>
|
|
<%= text_input f, :message, value: @message, placeholder: "Enter your message…" %>
|
|
</form>
|