From 0ac5950f8c50bfcb6ce6cd89c0e80d982513cd15 Mon Sep 17 00:00:00 2001 From: David Gay Date: Tue, 6 Jul 2021 20:11:20 -0400 Subject: Increase chat message area chat message limit from 100 to 200, and add a chat history page that shows the last 2,000 messages --- app/views/application/_chat.html.erb | 21 ++++++++++++++------- app/views/chat_messages/index.html.erb | 9 +++++++++ 2 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 app/views/chat_messages/index.html.erb (limited to 'app/views') diff --git a/app/views/application/_chat.html.erb b/app/views/application/_chat.html.erb index b656ed7..1ba6f8f 100644 --- a/app/views/application/_chat.html.erb +++ b/app/views/application/_chat.html.erb @@ -3,13 +3,20 @@
- <%= 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 %> +
+
+ <%= 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 %> +
+
+ <%= link_to "History", chat_messages_path %> +
+
<% end %> diff --git a/app/views/chat_messages/index.html.erb b/app/views/chat_messages/index.html.erb new file mode 100644 index 0000000..8791e7b --- /dev/null +++ b/app/views/chat_messages/index.html.erb @@ -0,0 +1,9 @@ +

+ Chat History +

+ +

Last 2,000 messages listed from newest to oldest.

+ +
+ <%= render "chat_messages/list" %> +
-- cgit v1.2.3