Updated by <%= link_to comment.updater_name, user_path(comment.updater_id) %> <%= time_ago_in_words_tagged(comment.updated_at) %>.
+ <% end %>diff --git a/app/assets/stylesheets/specific/comments.css.scss b/app/assets/stylesheets/specific/comments.css.scss index e6a1e85ea..90a59d3e1 100644 --- a/app/assets/stylesheets/specific/comments.css.scss +++ b/app/assets/stylesheets/specific/comments.css.scss @@ -4,6 +4,11 @@ div.comments-for-post { div.notices { margin: 1em 0; } + + .info { + color: #AAA; + font-style: italic; + } div.list-of-comments { article.comment { diff --git a/app/models/comment.rb b/app/models/comment.rb index ce1e9dfa5..42b3b7577 100644 --- a/app/models/comment.rb +++ b/app/models/comment.rb @@ -5,6 +5,7 @@ class Comment < ActiveRecord::Base belongs_to :creator, :class_name => "User" has_many :votes, :class_name => "CommentVote", :dependent => :destroy before_validation :initialize_creator, :on => :create + before_validation :initialize_updater after_save :update_last_commented_at after_destroy :update_last_commented_at attr_accessible :body, :post_id, :do_not_bump_post @@ -70,9 +71,18 @@ class Comment < ActiveRecord::Base self.ip_addr = CurrentUser.ip_addr end + def initialize_updater + self.updater_id = CurrentUser.user.id + self.updater_ip_addr = CurrentUser.ip_addr + end + def creator_name User.id_to_name(creator_id) end + + def updater_name + User.id_to_name(updater_id) + end def validate_creator_is_not_limited if creator.can_comment? @@ -111,7 +121,7 @@ class Comment < ActiveRecord::Base end def editable_by?(user) - creator_id == user.id || user.is_moderator? + creator_id == user.id || user.is_janitor? end end diff --git a/app/views/comments/partials/show/_comment.html.erb b/app/views/comments/partials/show/_comment.html.erb index 3e7e45e54..039dfcf45 100644 --- a/app/views/comments/partials/show/_comment.html.erb +++ b/app/views/comments/partials/show/_comment.html.erb @@ -8,6 +8,10 @@
Updated by <%= link_to comment.updater_name, user_path(comment.updater_id) %> <%= time_ago_in_words_tagged(comment.updated_at) %>.
+ <% end %>