Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move chat to new page, remove second navbar #177

Merged
merged 5 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions app/controllers/home_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@ def filter_users_status
@users = @users.sample(maximum_length_user_list)
end

def chat
if user_signed_in?
@room_messages = Room.global_chat_room.room_messages
render 'home/chat_page'
else
render 'index'
end
end

private

def maximum_length_user_list
Expand Down
5 changes: 5 additions & 0 deletions app/views/home/chat_page.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<%= stylesheet_link_tag 'home', media: 'all', 'data-turbolinks-track': 'reload' %>
<%= stylesheet_link_tag 'home_mobile', media: 'all', 'data-turbolinks-track': 'reload' %>


<%= render 'chat' %>
19 changes: 1 addition & 18 deletions app/views/home/dashboard.html+mobile.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,25 +3,8 @@

<div id="dashboard">
<div id="content">
<div class="tab-content">
<div id="users" class="tab-pane fade show active">
<div id="users">
<%= render 'users' %>
</div>
<div id="chat" class="tab-pane fade">
<%= render 'chat' %>
</div>
</div>
</div>
<div id="navigation">
<ul class="nav nav-pills nav-justified">
<li class="nav-item">
<a class="nav-link active" data-toggle="pill" href="#users">
<i class="fa fa-group"></i>
</a></li>
<li class="nav-item">
<a class="nav-link" data-toggle="pill" href="#chat">
<i class="fa fa-comments"></i>
</a></li>
</ul>
</div>
</div>
frcroth marked this conversation as resolved.
Show resolved Hide resolved
10 changes: 5 additions & 5 deletions app/views/layouts/_footer.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,16 @@
<div id="navigation">
<ul class="nav nav-pills nav-justified">
<li class="nav-item">
<!-- new path to this when dashboard is rewritten -->
<a class="nav-link <%= active_link_to_class(root_path, active: :exclusive)%>" href="<%= root_url %>">
<i class="fa fa-home"></i>
</a></li>
<li class="nav-item">
<!-- please update the path when reworked the chat -->
<a class="nav-link <%= active_link_to_class(root_path, active: :exclusive)%>" href="<%= root_url %>">
<a class="nav-link <%= active_link_to_class(chat_path, active: :exclusive)%>" href="<%= chat_path %>">
<i class="fa fa-comments"></i>
</a></li>
<li class="nav-item">
<a class="nav-link <%= active_link_to_class(user_contacts_path(current_user), active: :exclusive)%>" href="<%= user_contacts_path(current_user) %>">
<a class="nav-link <%= active_link_to_class(user_contacts_path(current_user), active: :exclusive)%>"
href="<%= user_contacts_path(current_user) %>">
<i class="fa fa-address-book"></i>
</a></li>
<li class="nav-item">
Expand All @@ -21,7 +20,8 @@
<i class="fa fa-history"></i>
</a></li>
<li class="nav-item">
<a class="nav-link <%= active_link_to_class(edit_user_path(current_user), active: :exclusive)%>" href="<%= edit_user_path(current_user) %>">
<a class="nav-link <%= active_link_to_class(edit_user_path(current_user), active: :exclusive)%>"
href="<%= edit_user_path(current_user) %>">
<i class="fa fa-cog"></i>
</a></li>
</ul>
Expand Down
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,6 @@

resources :activities, only: :create
resources :jitsi_calls, only: :create

get '/chat', to: 'home#chat', as: 'chat'
frcroth marked this conversation as resolved.
Show resolved Hide resolved
end