diff options
author | David Gay <david@davidgay.org> | 2021-05-25 18:03:46 -0400 |
---|---|---|
committer | David Gay <david@davidgay.org> | 2021-05-25 18:03:46 -0400 |
commit | 973743fb2b7f099b7abb70541bf6cadbb2aeac57 (patch) | |
tree | b0acb5b9aaa13709c2d15940b7eeb104ed5a4f50 | |
parent | 60b1c2fbda7f67810fbda5f5bb671a0e123be5e4 (diff) | |
parent | fcaef4f8144221bb2b4b9f77525bd8b8767e226a (diff) |
Merge branch 'develop'
-rw-r--r-- | Gemfile | 3 | ||||
-rw-r--r-- | app/controllers/home_controller.rb | 1 | ||||
-rw-r--r-- | app/views/application/_chat.html.erb | 26 |
3 files changed, 15 insertions, 15 deletions
@@ -66,6 +66,3 @@ group :test do # Easy installation and use of web drivers to run system tests with browsers gem "webdrivers" end - -# Windows does not include zoneinfo files, so bundle the tzinfo-data gem -gem "tzinfo-data", platforms: [:mingw, :mswin, :x64_mingw, :jruby] diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb index be6be01..a224f7b 100644 --- a/app/controllers/home_controller.rb +++ b/app/controllers/home_controller.rb @@ -2,5 +2,6 @@ class HomeController < ApplicationController skip_before_action :authenticate_user! def index + redirect_to character_path(current_char) if current_char end end diff --git a/app/views/application/_chat.html.erb b/app/views/application/_chat.html.erb index 8abe73c..f8aa4ad 100644 --- a/app/views/application/_chat.html.erb +++ b/app/views/application/_chat.html.erb @@ -1,13 +1,15 @@ -<div data-controller="chat" class="flex flex-col h-full text-sm"> - <div data-chat-target="output" id="chat_output" class="overflow-auto flex-grow"> +<% if current_char %> + <div data-controller="chat" class="flex flex-col h-full text-sm"> + <div data-chat-target="output" id="chat_output" class="overflow-auto flex-grow"> + </div> + <div class="flex-none"> + <%= 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> - <div class="flex-none"> - <%= 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> +<% end %> |