Commit e6dc4d08 authored by Vanessa Silva's avatar Vanessa Silva
Browse files

Resolve merge conflicts

parent ac2024bb
Pipeline #41890 passed with stage
in 2 minutes and 4 seconds
......@@ -19,4 +19,18 @@
max-width: 1220px;
margin: 0 auto;
width: 50%;
}
\ No newline at end of file
}
.flash {
display: flex;
align-content: center;
justify-content: center;
&.notice {
background-color: rgba(94, 175, 18, 0.933);
}
&.alert {
background-color: red;
}
}
......@@ -127,4 +127,13 @@ label{
.ml-10{
margin-left: 10px;
}
.no-matches-message{
margin-top: 20px;
margin-left: 15px;
}
.mb-6{
margin-bottom: 6rem;
}
\ No newline at end of file
class MessagesController < ApplicationController
class MessagesController < AuthenticationsController
def index
@users = User.all
@current_matches = current_user.match_users if user_signed_in?
@current_matches = current_user.match_users
end
def show # rubocop:disable Metrics/AbcSize
......
class Message < ApplicationRecord
belongs_to :sender, class_name: 'User'
belongs_to :receiver, class_name: 'User'
end
......@@ -2,11 +2,6 @@
<% if user_signed_in? %>
<div class="grid-container">
<div class="page-division">
<% if @match_users.empty? %>
<div>
<h2>No matches yet!</h2>
</div>
<% else %>
<div>
<% if current_user.profile_picture.attached? %>
<div class="background-name">
......@@ -20,6 +15,11 @@
</div>
<% end %>
</div>
<% if @match_users.empty? %>
<div class="no-matches-message">
<h2>No matches yet!</h2>
</div>
<% else %>
<div class="space-messages">
<span class="matches-text">Matches</span>
<span><%= link_to 'Messages', messages_path, class: 'anchor-style matches-text' %></span>
......@@ -43,9 +43,9 @@
<% end %>
<% end %>
</div>
<div>
<div class="mb-6">
<% if @possible_match.nil? %>
<div>
<div class="card-center">
<h1>No more people to see, sorry!</h1>
</div>
<% else %>
......
......@@ -16,10 +16,10 @@
<body>
<% if notice %>
<p class="flash notice"><%= notice %></p>
<span class="flash notice"><%= notice %></span>
<% end %>
<% if alert %>
<p class="flash alert"><%= alert %></p>
<span class="flash alert"><%= alert %></span>
<% end %>
<%= render 'shared/navbar' %>
<%= yield %>
......
......@@ -19,7 +19,7 @@
<% end %>
</div>
<% end %>
<%= f.submit "Chat", class: "btn btn-primary mt-10 mb-30" %>
<%= f.submit "Chat", class: "btn btn-primary mt-10 mb-10" %>
</div>
<% end %>
</div>
......
......@@ -2,7 +2,7 @@
<h2><%=@sender.first_name %> contacting <%=@receiver.first_name%></h2>
<div id="messages">
<% @messages.each do |message| %>
<p><%= message.sender_id %>: <%= message.text %></p>
<p><%= message.sender.first_name %>: <%= message.text %></p>
<% end %>
</div>
......
......@@ -70,8 +70,9 @@ Rails.application.configure do
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Uncomment if you wish to allow Action Cable access from any origin.
# config.action_cable.disable_request_forgery_protection = true
config.action_mailer.default_url_options = { host: 'localhost', port: 3000 }
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment