diff --git a/app/models/message.rb b/app/models/message.rb index 669787f..9b30325 100644 --- a/app/models/message.rb +++ b/app/models/message.rb @@ -17,4 +17,9 @@ class Message < ActiveRecord::Base belongs_to :sender, :class_name => "Profile" belongs_to :receiver, :class_name => "Profile" validates_presence_of :body, :subject, :sender, :receiver + + + def unread? + !read + end end diff --git a/app/views/messages/_list.html.erb b/app/views/messages/_list.html.erb index abbd79a..7155337 100644 --- a/app/views/messages/_list.html.erb +++ b/app/views/messages/_list.html.erb @@ -30,9 +30,9 @@ sent = params[:action]=='sent' <% list.each do |m| mail_user = (@p == m.sender ? m.receiver : m.sender)%> - ><%= link_to mail_user.f, mail_user %> - ><%= time_ago_in_words m.created_at %> - ><%= link_to h( m.subject), message_path(m) %> + ><%= link_to mail_user.f, mail_user %> + ><%= time_ago_in_words m.created_at %> + ><%= link_to h( m.subject), message_path(m) %> <% end %> diff --git a/app/views/messages/_message.html.erb b/app/views/messages/_message.html.erb index bfb2a65..e8c4e21 100644 --- a/app/views/messages/_message.html.erb +++ b/app/views/messages/_message.html.erb @@ -27,5 +27,5 @@ to_list ||= @to_list \ No newline at end of file diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 4849429..3a82b80 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -134,7 +134,7 @@ h2 a {text-transform: capitalize; font-weight: normal; font-size: 11px;} #messages th {padding: 3px;} #messages th {background: #971d4a; font-size: 10px;} #messages {width: 100%;} -#messages .unread {font-weight: bold;} +.unread {font-weight: bold;} .blurp {padding: 0 0 15px 0;} .blurp strong {display: block; color: white;}