This commit is contained in:
albert
2013-02-19 14:10:13 -05:00
parent 3fecc3fb82
commit ad6ad8074e
3 changed files with 17 additions and 8 deletions

View File

@@ -0,0 +1,9 @@
div#c-user-feedbacks {
tr.feedback-category-positive {
background: #DDFFDD !important;
}
tr.feedback-category-negative {
background: #FFDDDD !important;
}
}

View File

@@ -55,11 +55,11 @@ class UserFeedback < ActiveRecord::Base
end
def user_name
if user
user.name
else
nil
end
User.id_to_name(user_id)
end
def creator_name
User.id_to_name(creator_id)
end
def user_name=(name)

View File

@@ -14,10 +14,10 @@
</thead>
<tbody>
<% @user_feedbacks.each do |feedback| %>
<tr>
<tr class="feedback-category-<%= feedback.category %>">
<td><%= feedback.category %></td>
<td><%= link_to feedback.user_name, user_feedback_path(feedback.user_id) %></td>
<td><%= feedback.creator.name %></td>
<td><%= link_to feedback.user_name, user_path(feedback.user_id) %></td>
<td><%= link_to feedback.creator_name, user_path(feedback.creator_id) %></td>
<td><%= time_ago_in_words_tagged(feedback.created_at) %> ago</td>
<td><%= format_text(feedback.body) %></td>
</tr>