summaryrefslogtreecommitdiff
path: root/app/views/users/show.html.erb
diff options
context:
space:
mode:
authorMrYummy <elemental428@gmail.com>2017-06-15 15:04:15 +0200
committerMrYummy <elemental428@gmail.com>2017-06-15 15:04:15 +0200
commitdd193e740ad86c9841ed55f54b85fe91ee5da05a (patch)
tree35465ce3411e5ab643783c74bd4e617068b736be /app/views/users/show.html.erb
parent9b50ec652cd8f80a16bd82987bd9f8eba389a2eb (diff)
Added 'read' check; message name is only bold if unread
Diffstat (limited to 'app/views/users/show.html.erb')
-rw-r--r--app/views/users/show.html.erb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/users/show.html.erb b/app/views/users/show.html.erb
index a48eae2..e2e9348 100644
--- a/app/views/users/show.html.erb
+++ b/app/views/users/show.html.erb
@@ -11,7 +11,7 @@
<%= link_to "edit profile", edit_user_path(@user), :class => "btn blue" %>
<% end %>
<% if @user.is?(current_user) %>
- <%= link_to "Private Messages (#{Message.where("user_sender_id = ? OR user_target_id = ?", current_user.id, current_user.id).count})", messages_path, :class => "btn blue" %>
+ <%= link_to "Private Messages (#{Message.where(read: false).count})", messages_path, :class => "btn blue" %>
<% elsif current_user %>
<%= link_to "Send this user a message", new_message_path(user_target: @user.ign), :class => "btn blue" %>
<% end %>