diff --git a/app/views/application/_update_notice.html.erb b/app/views/application/_update_notice.html.erb new file mode 100644 index 000000000..2f8e0a056 --- /dev/null +++ b/app/views/application/_update_notice.html.erb @@ -0,0 +1,7 @@ +<%# record, interval %> + +<% if record.respond_to?(:updater) && record.updater != record.creator %> +
Updated by <%= link_to_user record.updater %> <%= time_ago_in_words_tagged(record.updated_at) %>
+<% elsif record.updated_at - record.created_at > (local_assigns[:interval] || 5.minutes) %> +Updated <%= time_ago_in_words_tagged(record.updated_at) %>
+<% end %> diff --git a/app/views/comments/partials/show/_comment.html.erb b/app/views/comments/partials/show/_comment.html.erb index ebf40b634..de5bf1b63 100644 --- a/app/views/comments/partials/show/_comment.html.erb +++ b/app/views/comments/partials/show/_comment.html.erb @@ -16,9 +16,7 @@Updated by <%= link_to_user comment.updater %> <%= time_ago_in_words_tagged(comment.updated_at) %>
- <% end %> + <%= render "update_notice", record: comment %>Updated by <%= link_to_user forum_post.updater %> <%= time_ago_in_words_tagged(forum_post.updated_at) %>
- <% end %> + <%= render "update_notice", record: forum_post %>