Skip to content

Commit

Permalink
fixng up assimovt's changes just a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
stevenbristol committed Aug 1, 2008
1 parent c206361 commit 9ce5c66
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 5 deletions.
5 changes: 5 additions & 0 deletions app/models/message.rb
Expand Up @@ -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
6 changes: 3 additions & 3 deletions app/views/messages/_list.html.erb
Expand Up @@ -30,9 +30,9 @@ sent = params[:action]=='sent'
<% list.each do |m|
mail_user = (@p == m.sender ? m.receiver : m.sender)%>
<tr>
<td <%= "class=\"unread\"" if !m.read %>><%= link_to mail_user.f, mail_user %></td>
<td <%= "class=\"unread\"" if !m.read %>><%= time_ago_in_words m.created_at %></td>
<td <%= "class=\"unread;\"" if !m.read %>><%= link_to h( m.subject), message_path(m) %></td>
<td<%= ' class="unread"' if m.unread? %>><%= link_to mail_user.f, mail_user %></td>
<td<%= ' class="unread"' if m.unread? %>><%= time_ago_in_words m.created_at %></td>
<td<%= ' class="unread"' if m.unread? %>><%= link_to h( m.subject), message_path(m) %></td>
</tr>
<% end %>
</table>
Expand Down
2 changes: 1 addition & 1 deletion app/views/messages/_message.html.erb
Expand Up @@ -27,5 +27,5 @@ to_list ||= @to_list


<div id="new_reply" class="hidden">
<%= render :partial => "messages/form" %>
<%= render :partial => "messages/form", :locals => {:hide_header => true} %>
</div>
2 changes: 1 addition & 1 deletion public/stylesheets/application.css
Expand Up @@ -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;}
Expand Down

0 comments on commit 9ce5c66

Please sign in to comment.